Handson-ml-master笔记本电脑出现问题

时间:2019-04-13 18:56:10

标签: python jupyter-notebook

我开始阅读“使用Scikit-Learn和TensorFlow进行动手机器学习”,并在Anaconda上使用Jupyter Notebook来处理handon-ml-master笔记本。我按照GitHub ageron / handson-ml安装说明进行操作,以使用Python3.5在Mac上安装环境(mlbook)。在第二个安装步骤中,我收到一个错误:

CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.

To initialize your shell, run 
$ conda init <SHELL_NAME>

当前支持的shell是:     -重击     -鱼     -tcsh     -xonsh     -zsh     -Powershell

因为我通常使用ksh。因此,我执行了bash,执行了,然后重新执行了命令。我收到了相同的错误,所以我退出Terminal并从ksh尝试,即execute,重新执行了命令,然后收到了相同的错误。因此,我只是继续执行第3和第4步安装而没有错误。

我运行了Anaconda Navigator,启动了Jupyter Notebook,导航到handson-ml-master笔记本,并加载了第1章(01_the_machine_learning_landscape)。运行第一个单元格会产生错误:

  File "<ipython-input-1-d884c8330a3b>", line 1
    **Chapter 1 – The Machine Learning landscape**
     ^
  SyntaxError: invalid syntax

Running the 2nd code cell produces nothing because I am using Python3.5, but running the 3rd code cell produces another error:

  File "<ipython-input-3-7dc69e9611c0>", line 31
    import warningsexit()
                       ^
  SyntaxError: invalid syntax

但是,运行“以下全部运行:”会生成所有图形,并成功执行除一个数据/图形生成单元In [29]以外的所有图形,并提供以下错误:

  Saving figure overfitting_model_plot
  /Users/<user>/anaconda3/envs/mlbook/lib/python3.5/site-packages/numpy/core/_methods.py:116: RuntimeWarning: overflow encountered in multiply
    x = um.multiply(x, x, out=x)
  /Users/<user>/anaconda3/envs/mlbook/lib/python3.5/site-packages/numpy/core/_methods.py:117: RuntimeWarning: overflow encountered in reduce
    ret = umr_sum(x, axis, dtype, out, keepdims)

现在,我想知道为什么我的笔记本中的安装和运行代码似乎有问题。任何帮助将不胜感激,因此我可以继续进行笔记本项目的其余部分。

0 个答案:

没有答案
相关问题