【问题标题】:How to install TensorFlow in jupyter notebook on Azure Machine Learning Studio如何在 Azure 机器学习工作室的 jupyter notebook 中安装 TensorFlow
【发布时间】:2017-04-23 06:15:59
【问题描述】:

我正在尝试测试 Azure 机器学习工作室。

我想使用 TensorFlow,但 Jupyter notebook 上没有安装它。

如何在 notebook 上使用一些机器学习库,如 TensorFlow、Theano、Keras...?

我试过这个:

!pip install tensorflow 

但是,我得到了如下错误:

Collecting tensorflow
  Downloading tensorflow-0.12.0rc0-cp34-cp34m-manylinux1_x86_64.whl (43.1MB)
    100% |################################| 43.1MB 27kB/s 
Collecting protobuf==3.1.0 (from tensorflow)
  Downloading protobuf-3.1.0-py2.py3-none-any.whl (339kB)
    100% |################################| 348kB 3.7MB/s 
Collecting six>=1.10.0 (from tensorflow)
  Downloading six-1.10.0-py2.py3-none-any.whl
Requirement already satisfied: numpy>=1.11.0 in /home/nbcommon/anaconda3_23/lib/python3.4/site-packages (from tensorflow)
Requirement already satisfied: wheel>=0.26 in /home/nbcommon/anaconda3_23/lib/python3.4/site-packages (from tensorflow)
Requirement already satisfied: setuptools in /home/nbcommon/anaconda3_23/lib/python3.4/site-packages/setuptools-27.2.0-py3.4.egg (from protobuf==3.1.0->tensorflow)
Installing collected packages: six, protobuf, tensorflow
  Found existing installation: six 1.9.0
    DEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
    Uninstalling six-1.9.0:
      Successfully uninstalled six-1.9.0
  Rolling back uninstall of six
Exception:
Traceback (most recent call last):
  File "/home/nbcommon/anaconda3_23/lib/python3.4/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/home/nbcommon/anaconda3_23/lib/python3.4/site-packages/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/home/nbcommon/anaconda3_23/lib/python3.4/site-packages/pip/req/req_set.py", line 784, in install
    **kwargs
  File "/home/nbcommon/anaconda3_23/lib/python3.4/site-packages/pip/req/req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/home/nbcommon/anaconda3_23/lib/python3.4/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "/home/nbcommon/anaconda3_23/lib/python3.4/site-packages/pip/wheel.py", line 345, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/home/nbcommon/anaconda3_23/lib/python3.4/site-packages/pip/wheel.py", line 329, in clobber
    os.utime(destfile, (st.st_atime, st.st_mtime))
PermissionError: [Errno 1] Operation not permitted

【问题讨论】:

    标签: tensorflow theano jupyter-notebook keras azure-machine-learning-studio


    【解决方案1】:

    如您所见,活动用户无权写入 Azure 机器学习工作室笔记本中的 site-packages 目录。您可以尝试将包安装到您确实具有写入权限的另一个目录(如默认工作目录)并从那里导入,但我建议使用以下低麻烦选项。

    Azure Notebooks 是一个独立的 Jupyter Notebook 服务,可让您安装 tensorflow、theano 和 keras。与 AML Studio 中的笔记本一样,这些笔记本将保留在您的帐户中。主要的缺点是,如果您想通过例如访问您的工作区。 Python azureml 包,你需要provide your workspace id/authorization token 来建立连接。 (在 Azure ML Studio 中,这些值是从当前工作区自动加载的。)否则,我相信 Azure Notebooks 可以完成您过去在 AML Studio 中执行的所有操作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-06-25
      • 1970-01-01
      • 1970-01-01
      • 2017-06-24
      • 2021-03-28
      相关资源
      最近更新 更多