安装

Hi @Dabour, release 都在 https://github.com/apache/incubator-mxnet/releases. 请注意 d2l 使用 mxnet 1.7~

jupyter notebook在linux云服务器安装好了,但是为什么从本地浏览器打不开呢

请大神帮看看这个安装的是否正确呢?我发现一个疑点,跟教程里面不一样的是,我这个jupyter server的网址里面还有token,是不是版本不正确呢?

加上–ip=0.0.0.0后解决,打扰!

1 Like

Ver2 版还支持Windows10 平台吗?没看到相关的安装描述。是不是对于Win用户,只能安装虚拟机之后才能用?
Ver1时,是支持Windows的,http://zh.d2l.ai/chapter_prerequisite/install.html

Hi @zppet, 暂时没有调配Windows,建议直接上云+gpu,方便未来较大model运算。

1 Like

请教一下,这个安装后续需要用到互联网吗?我可以安装在我这边的内网中吗?

我这个是VMcenter里面的虚拟机,可以运行吗?应该是属于没有独立显卡的那种

你好!安装GPU版本的MXnet过程中报错:
Building wheel for numpy (setup.py) … error
请问是什么原因?Python为3.8版本,CUDA退回10.2版本,
用pip install mxnet-cu102==1.7.0 -f https://dist.mxnet.io/python安装无法成功

1 Like

解决了,应该是因为Python版本太高,从3.8回退至3.6后安装没问题了。

Unreadable Notebook: /Users/leon/study/AI/d2l-zh/tensorflow/index.ipynb NotJSONError(“Notebook does not appear to be JSON: ‘’…”)

按照安装步骤完成了但是出现两个问题。
OS:ubuntu-20.04.1
python3.8 | Miniconda3 Linux 64-bit

1.conda activate d2l后,python中
No module named ‘mxnet’.

2.运行jupyter notebook
jupyter command ‘jupyter-notebook’ not found.

请高手赐教。

以上问题是GPU安装时出现的。
又按照CPU的放发安装了一次,运行jupyter notebook成功。

问题如下:

python3.6 | Miniconda3-4.3.31-Linux-x86_64.sh

1.conda activate d2l后,python中import mxnet
lllegal instruction (core dumped)

请教高手,谢谢。

OS:ubuntu-20.04.1
python3.8 | Miniconda3 Linux 64-bit

第二个问题解决了,运行了
pip install -U d2l

第一个问题发生了变化
1.conda activate d2l后,python中import mxnet
lllegal instruction (core dumped)

请问一下,安装了mxnet过后,import的时候出现module ‘numpy’ has no attribute ‘histogram_bin_edges’,我把mxnet卸载了又安装,还是不行呢

在Win10上安装了基于CPU的环境,可以成功运行。大致步骤:

  1. 先安装miniconda -https://docs.conda.io/en/latest/miniconda.html , 我选的是python3.8
  2. 激活base环境 -cmdline窗口使用命令conda activate base
  3. 到pytorch主页(Start Locally | PyTorch ),获取安装pytorch的命令,我的大概是:conda install pytorch torchvision torchaudio cpuonly -c pytorch

    如果安装中遇到如下错误:
RemoveError: 'requests' is a dependency of conda and cannot be removed from
conda's operating environment.

请使用如下命令更新:conda update --force conda
然后再尝试安装pytorch
4. 然后安装jupyter 和d2l包,在base 环境下,输入pip install jupyter d2l


5. 下载教程的jupyter记事本,就在教材页面右上方工具栏中(《动手学深度学习》 — 动手学深度学习 2.0.0 documentation

找个合适的目录解压缩

  1. 在base环境下启动jupyter notebook
  2. 一切正常,浏览器自动弹出,即可打开各章节jupyter notebook进行学习和试验了。
    (注:由于是本地CPU版本,很多模型训练很慢,甚至是训练不出来)
2 Likes

麻烦看看如下的问题,安装之后遇到RuntimeError,在浏览器出现了ImportError,如下图,求解答,谢谢。


(d2l) E:\AI\DeepLearning Tools\d2l-zh v2>jupyter notebook
[W 16:19:12.024 NotebookApp] Terminals not available (error was No module named ‘winpty.winpty’)
[I 16:19:12.026 NotebookApp] Serving notebooks from local directory: E:\AI\DeepLearning Tools\d2l-zh v2
[I 16:19:12.026 NotebookApp] Jupyter Notebook 6.4.0 is running at:
[I 16:19:12.026 NotebookApp] http://localhost:8888/?token=6147b72317382d92941f2d33458822da54cb725be075da4f
[I 16:19:12.026 NotebookApp] or http://127.0.0.1:8888/?token=6147b72317382d92941f2d33458822da54cb725be075da4f
[I 16:19:12.026 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 16:19:12.078 NotebookApp]

To access the notebook, open this file in a browser:
    file:///C:/Users/GAME-1/AppData/Roaming/jupyter/runtime/nbserver-13528-open.html
Or copy and paste one of these URLs:
    http://localhost:8888/?token=6147b72317382d92941f2d33458822da54cb725be075da4f
 or http://127.0.0.1:8888/?token=6147b72317382d92941f2d33458822da54cb725be075da4f

ERROR:asyncio:Exception in callback <TaskWakeupMethWrapper object at 0x000001C799F35258>(<Future finis…bbf"\r\n\r\n’>)
handle: <Handle <TaskWakeupMethWrapper object at 0x000001C799F35258>(<Future finis…bbf"\r\n\r\n’>)>
Traceback (most recent call last):
File “c:\users\game-1.conda\envs\d2l\lib\asyncio\events.py”, line 88, in _run
self._context.run(self._callback, *self._args)
RuntimeError: Cannot enter into task <Task pending coro=<HTTP1ServerConnection._server_request_loop() running at c:\users\game-1.conda\envs\d2l\lib\site-packages\tornado\http1connection.py:823> wait_for=<Future finished result=b’GET /api/co…2bbf"\r\n\r\n’> cb=[IOLoop.add_future..() at c:\users\game-1.conda\envs\d2l\lib\site-packages\tornado\ioloop.py:688]> while another task <Task pending coro=<MappingKernelManager.start_kernel() running at c:\users\game-1.conda\envs\d2l\lib\site-packages\notebook\services\kernels\kernelmanager.py:176> cb=[IOLoop.add_future..() at c:\users\game-1.conda\envs\d2l\lib\site-packages\tornado\ioloop.py:688]> is being executed.
ERROR:asyncio:Exception in callback <TaskWakeupMethWrapper object at 0x000001C798AFD618>(<Future finis…bbf"\r\n\r\n’>)
handle: <Handle <TaskWakeupMethWrapper object at 0x000001C798AFD618>(<Future finis…bbf"\r\n\r\n’>)>
Traceback (most recent call last):
File “c:\users\game-1.conda\envs\d2l\lib\asyncio\events.py”, line 88, in _run
self._context.run(self._callback, *self._args)
RuntimeError: Cannot enter into task <Task pending coro=<HTTP1ServerConnection._server_request_loop() running at c:\users\game-1.conda\envs\d2l\lib\site-packages\tornado\http1connection.py:823> wait_for=<Future finished result=b’GET /kernel…2bbf"\r\n\r\n’> cb=[IOLoop.add_future..() at c:\users\game-1.conda\envs\d2l\lib\site-packages\tornado\ioloop.py:688]> while another task <Task pending coro=<MappingKernelManager.start_kernel() running at c:\users\game-1.conda\envs\d2l\lib\site-packages\notebook\services\kernels\kernelmanager.py:176> cb=[IOLoop.add_future..() at c:\users\game-1.conda\envs\d2l\lib\site-packages\tornado\ioloop.py:688]> is being executed.
[I 16:19:18.462 NotebookApp] Kernel started: 6f50232a-d0a4-4d0e-925d-396086f76a59, name: python3
[W 16:19:19.128 NotebookApp] 404 GET /static/components/MathJax/fonts/HTML-CSS/TeX/otf/MathJax_AMS-Regular.otf (::1) 5.980000ms referer=http://localhost:8888/notebooks/chapter_preliminaries/ndarray.ipynb

你好,我按照你的步骤进行了安装,安装的时候一切正常。但是到了激活环境的时候,就不行了
报错如下
输入:conda activate d2l
报错:Could not find conda environment: d2l
You can list all discoverable environments with conda info --envs.
请问您有遇到这样的问题吗?

d2l是咱们教程用的Python 包,而不是conda虚拟环境。你需要激活的是base虚拟环境,命令是:conda activate base

非常感谢,现在activate base和deactivate都正常了。
但是我在打开jupyter notebook里的项目例子时,
报错:
[W 13:43:39.079 NotebookApp] 404 GET /api/contents/d2l-zh/pytorch/chapter_linear-networks?type=directory&=1628573992115 (::1): No such file or directory: d2l-zh/pytorch/chapter_linear-networks
[W 13:43:39.087 NotebookApp] No such file or directory: d2l-zh/pytorch/chapter_linear-networks
[W 13:43:39.091 NotebookApp] 404 GET /api/contents/d2l-zh/pytorch/chapter_linear-networks?type=directory&
=1628573992115 (::1) 16.120000ms referer=http://localhost:8888/tree/d2l-zh/pytorch/chapter_linear-networks
[W 13:43:58.612 NotebookApp] Notebook pytorch/chapter_linear-networks/linear-regression-concise.ipynb is not trusted
Bad file descriptor (C:\projects\libzmq\src\epoll.cpp:100)
请指点,谢谢!