【问题标题】:Jupyter Notebook Kernel dying on specific enviormentJupyter Notebook 内核在特定环境中死机
【发布时间】:2020-07-20 17:37:29
【问题描述】:

我最近重新安装了我的 Anaconda,然后我创建了一个名为 myenv 的新 Conda 环境。 然后我在其中安装了必要的包,例如 Jupyter、Numpy、Pandas、Tensorflow 2、Keras 等。

现在,当我打开 Jupyter 笔记本时,它正在工作。当我点击 New Notebook> Python 3 : (myenv) 时, 它给了我一个非常大的错误,内核正在死去。

我认为该错误与我的 NVIDIA 驱动程序有关,但之前运行良好。

另外,当我检测GPU时

import tensorflow as tf
tf.test.is_gpu_available()

然后经过长时间的输出,它给出了

GPU:0 with 1380 MB memory) -> physical GPU (device: 0, name: GeForce MX110, pci bus id: 0000:01:00.0, compute capability: 5.0)
2020-07-20 22:32:54.350989: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x20284f8ac10 initialized for platform CUDA (this does not guarantee that XLA will be used). Devices:
2020-07-20 22:32:54.355860: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): GeForce MX110, Compute Capability 5.0
Out[2]: True

这意味着 GPU 正在工作。

我在 Jupyter Notebook 中遇到的错误是

[W 22:33:54.958 NotebookApp] 404 GET /nbextensions/widgets/notebook/js/extension.js?v=20200720222753 (::1) 10.00ms referer=http://localhost:8888/notebooks/Desktop/Untitled1.ipynb
[E 22:33:56.401 NotebookApp] Failed to run command:
    ['C:\\Anaconda\\envs\\myenv\\python.exe', '-m', 'ipykernel_launcher', '-f', 'C:\\Users\\Ahmad Mustafa Anis\\AppData\\Roaming\\jupyter\\runtime\\kernel-d6e4e2e3-6570-48ac-808e-8a456b430033.json']
        PATH='C:\\Anaconda\\envs\\myenv;C:\\Anaconda\\envs\\myenv\\Library\\mingw-w64\\bin;C:\\Anaconda\\envs\\myenv\\Library\\usr\\bin;C:\\Anaconda\\envs\\myenv\\Library\\bin;C:\\Anaconda\\envs\\myenv\\Scripts;C:\\Anaconda\\envs\\myenv\\bin;C:\\Anaconda\\condabin;C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.1\\bin;C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.1\\libnvvp;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0;C:\\Windows\\System32\\OpenSSH;C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\Program Files\\NVIDIA Corporation\\NVIDIA NvDLISR;C:\\Program Files\\NVIDIA Corporation\\Nsight Compute 2019.1;C:\\Program Files\\Git\\cmd;C:\\Anaconda;C:\\Anaconda\\Library\\mingw-w64\\bin;C:\\Anaconda\\Library\\usr\\bin;C:\\Anaconda\\Library\\bin;C:\\Anaconda\\Scripts;C:\\Users\\Ahmad Mustafa Anis\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\Ahmad Mustafa Anis\\AppData\\Local\\Programs\\Microsoft VS Code\\bin;C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.1\\bin;C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.1\\libnvvp;C:\\Users\\Ahmad Mustafa Anis\\Downloads\\cmder;.;C:\\Program Files\\JetBrains\\PyCharm Professional Edition with Anaconda plugin 2020.1.2\\bin;.'
        with kwargs:
    {'stdin': -1, 'stdout': None, 'stderr': None, 'cwd': 'C:\\Users\\Ahmad Mustafa Anis\\Desktop', 'close_fds': False}

[E 22:34:20.721 NotebookApp] Uncaught exception POST /api/sessions (::1)
    HTTPServerRequest(protocol='http', host='localhost:8888', method='POST', uri='/api/sessions', version='HTTP/1.1', remote_ip='::1')
    Traceback (most recent call last):
      File "c:\users\ahmad mustafa anis\.conda\envs\myenv\lib\site-packages\tornado\web.py", line 1703, in _execute
        result = await result
      File "c:\users\ahmad mustafa anis\.conda\envs\myenv\lib\site-packages\tornado\gen.py", line 742, in run
        yielded = self.gen.throw(*exc_info)  # type: ignore
      File "c:\users\ahmad mustafa anis\.conda\envs\myenv\lib\site-packages\notebook\services\sessions\handlers.py", line 72, in post
        type=mtype))
      File "c:\users\ahmad mustafa anis\.conda\envs\myenv\lib\site-packages\tornado\gen.py", line 735, in run
        value = future.result()
      File "c:\users\ahmad mustafa anis\.conda\envs\myenv\lib\site-packages\tornado\gen.py", line 742, in run
        yielded = self.gen.throw(*exc_info)  # type: ignore
      File "c:\users\ahmad mustafa anis\.conda\envs\myenv\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 88, in create_session
        kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
      File "c:\users\ahmad mustafa anis\.conda\envs\myenv\lib\site-packages\tornado\gen.py", line 735, in run
        value = future.result()
      File "c:\users\ahmad mustafa anis\.conda\envs\myenv\lib\site-packages\tornado\gen.py", line 742, in run
        yielded = self.gen.throw(*exc_info)  # type: ignore
      File "c:\users\ahmad mustafa anis\.conda\envs\myenv\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 101, in start_kernel_for_session
        self.kernel_manager.start_kernel(path=kernel_path, kernel_name=kernel_name)
      File "c:\users\ahmad mustafa anis\.conda\envs\myenv\lib\site-packages\tornado\gen.py", line 735, in run
        value = future.result()
      File "c:\users\ahmad mustafa anis\.conda\envs\myenv\lib\site-packages\tornado\gen.py", line 209, in wrapper
        yielded = next(result)
      File "c:\users\ahmad mustafa anis\.conda\envs\myenv\lib\site-packages\notebook\services\kernels\kernelmanager.py", line 168, in start_kernel
        super(MappingKernelManager, self).start_kernel(**kwargs)
      File "c:\users\ahmad mustafa anis\.conda\envs\myenv\lib\site-packages\jupyter_client\multikernelmanager.py", line 186, in start_kernel
        km.start_kernel(**kwargs)
      File "c:\users\ahmad mustafa anis\.conda\envs\myenv\lib\site-packages\jupyter_client\manager.py", line 308, in start_kernel
        self.kernel = self._launch_kernel(kernel_cmd, **kw)
      File "c:\users\ahmad mustafa anis\.conda\envs\myenv\lib\site-packages\jupyter_client\manager.py", line 215, in _launch_kernel
        return launch_kernel(kernel_cmd, **kw)
      File "c:\users\ahmad mustafa anis\.conda\envs\myenv\lib\site-packages\jupyter_client\launcher.py", line 135, in launch_kernel
        proc = Popen(cmd, **kwargs)
      File "c:\users\ahmad mustafa anis\.conda\envs\myenv\lib\subprocess.py", line 800, in __init__
        restore_signals, start_new_session)
      File "c:\users\ahmad mustafa anis\.conda\envs\myenv\lib\subprocess.py", line 1207, in _execute_child
        startupinfo)
    FileNotFoundError: [WinError 2] The system cannot find the file specified
[W 22:34:20.727 NotebookApp] Unhandled error
[E 22:34:20.728 NotebookApp] {
      "Host": "localhost:8888",
      "Connection": "keep-alive",
      "Content-Length": "149",
      "Accept": "application/json, text/javascript, */*; q=0.01",
      "X-Requested-With": "XMLHttpRequest",
      "X-Xsrftoken": "2|75d26d1d|23d90b6fbf2e9d8bd4e7f57882dbc1c6|1593362714",
      "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36",
      "Content-Type": "application/json",
      "Origin": "http://localhost:8888",
      "Sec-Fetch-Site": "same-origin",
      "Sec-Fetch-Mode": "cors",
      "Sec-Fetch-Dest": "empty",
      "Referer": "http://localhost:8888/notebooks/Desktop/Untitled2.ipynb?kernel_name=python37764bitmyenvconda4a11ba26287d4d1c969b9946e31eb2a2",
      "Accept-Encoding": "gzip, deflate, br",
      "Accept-Language": "en-US,en;q=0.9,ur;q=0.8",
      "Cookie": "_xsrf=2|75d26d1d|23d90b6fbf2e9d8bd4e7f57882dbc1c6|1593362714; username-localhost-8888=\"2|1:0|10:1595266075|23:username-localhost-8888|44:MjhjNzFlOWEyM2M4NDFjMzlkYWY4Mzc5YzRkMGFjNDc=|cd2a2851f9a9f34c991b1b89b72f8378035cc40aa421b0489e390366ed50e85b\""
    }
[E 22:34:20.728 NotebookApp] 500 POST /api/sessions (::1) 24336.38ms referer=http://localhost:8888/notebooks/Desktop/Untitled2.ipynb?kernel_name=python37764bitmyenvconda4a11ba26287d4d1c969b9946e31eb2a2
[W 22:34:20.737 NotebookApp] 404 GET /nbextensions/widgets/notebook/js/extension.js?v=20200720222753 (::1) 6.00ms referer=http://localhost:8888/notebooks/Desktop/Untitled2.ipynb?kernel_name=python37764bitmyenvconda4a11ba26287d4d1c969b9946e31eb2a2
[I 22:34:22.257 NotebookApp] Interrupted...
[I 22:34:22.258 NotebookApp] Shutting down 1 kernel
[I 22:34:22.558 NotebookApp] Kernel shutdown: 40dadb8b-1219-4bf9-a735-242f99f0b5b4

它提到了path,所以这是我的环境路径图片。

我很遗憾现在删除旧的工作 Anaconda。请帮我解决问题。谢谢

【问题讨论】:

    标签: windows tensorflow jupyter-notebook jupyter nvidia


    【解决方案1】:

    运行 Ubuntu 并且在我重新安装所有内容时也有快乐的时刻,但无法使用我的双 GPU 获得 tensorflow。

    我尝试了 10,000 种方法来安装 Ubuntu、Anaconda 等。

    什么有效 - 安装 ubuntu。安装 anaconda。

    conda 安装 tensorflow-gpu

    如果我这样做,conda install 会正确完成所有 nvidia 的事情 - 正确的 cudnn、工具包、驱动程序等。我一直在使用 pip install 并且大部分时间都在尝试完成驱动程序和所有 nvidia 的事情在张量流安装之前。 Pip install 没有安装正确的匹配 nvidia 的东西。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-05-14
      • 1970-01-01
      • 2018-12-02
      • 1970-01-01
      • 2021-10-24
      • 1970-01-01
      • 2019-08-01
      相关资源
      最近更新 更多