安装

麻烦看看如下的问题,安装之后遇到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)
请指点,谢谢!

错误码404一般表示服务端资源不存在。看样子你是不是没有把下载的jupyter notebooks解压?
我的是解压zip到我的windows用户目录,如图

我也是 请问你后来解决了嘛?我是win10系统 不知道你是什么系统……

解决从Ubuntu虚拟机上的jupyter映射到window的方法https://www.youtube.com/watch?v=qeJUsahqzw8&t=315s

1 Like

按照视频在ubuntu下安装完成了,jupyter notebook在本机也可以打开,可是在局域网内其他机子访问 ip地址:8888 提示拒绝连接

请问如果不是Nvidia显卡就不能下载GPU嘛?我是AMD显卡怎么办,没有GPU有什么影响吗

正式版,支持CUDA的,好像是只到1.7.0,更高版本只有CPU版本。
而且D2L这个项目,是基于1.7.0 的。

希望安装带有 GPU 支持的 MXNET,可以参考这篇文章:

MXNET不同版本对 CUDA 和 MKL 支持的情况,可以看 MXNET 网站:

我的完成步骤,根据知乎的文章和本文的教程:
0. 安装 Anaconda 3.0

  1. 安装 VisualStudio 2017

  2. 安装 NVidia CUDA 10.1

  3. 安装 NVidia CUDNN 8.05 For CUDA 10.1

  4. 安照本文的教程安装 MXNET 1.7.0

  5. 在验证 MXNET GPU 的时候( 参见 MXNET网站 Validate Your MXNet Installation 的 Python 部分)
    import mxnet as mx
    总是报错, libmxnet.dll 无法找到,其实是缺少了 CUDA最新的DLL库文件 CUDART64_101.dll
    从 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin 把这个文件复制到 Anaconda 创建的 d2l 环境中(libmxnet.dll所在的目录)就OK,我的目录是
    E:\anaconda3\envs\d2l\Lib\site-packages\mxnet

    安装成功后,启动 jupyter notebook
    创建一个新的 Notebook文件,输入以下内容:

from mxnet import nd, npx
npx.set_np()
import mxnet as mx
a = nd.ones((2, 3), mx.gpu())
a

输出结果应该为:
[[1. 1. 1.] [1. 1. 1.]] <NDArray 2x3 @gpu(0)>

说明已经是使用 GPU 上的数组,安装成功!


安装d2l出现这个怎么解决

安装d2l时出现这个问题,怎么解决呀

下载安装d2l安装包出错,numpy和pip都是最新,wheel也提前安装了
怎么解决?

他喵的,教程书上安装的mxnet都改成了nd,这里还是np.而且离谱的是d2l自己封装的包居然也是导入np, 导致后面微分那章一直报错。

如果要按着这边教程来建议安装mxnet1.7.0的版本

https://www.yuque.com/docs/share/74ef2801-8acc-4bc5-88b4-0dde22acb4c6?#(密码:yhm4) 《03 安装》 制作了Docker的版本,分享给大家

ERROR: Could not find a version that satisfies the requirement mxnet-cu114==1.7.0 (from versions: none)
ERROR: No matching distribution found for mxnet-cu114==1.7.0
您好,我老是出现这样的问题,要怎么解决呢?