Google ColabでGPUを使ってPytorchを使用したいのですが、ランタイムをGPUに変更して、
python
1import torch
を実行すると
python
1ValueError Traceback (most recent call last) 2<ipython-input-36-eb42ca6e4af3> in <module>() 3----> 1 import torch 4 5/usr/local/lib/python3.7/dist-packages/torch/__init__.py in <module>() 6 195 if USE_GLOBAL_DEPS: 7 196 _load_global_deps() 8--> 197 from torch._C import * # noqa: F403 9 198 10 199 # Appease the type checker; ordinarily this binding is inserted by the 11 12ValueError: module functions cannot set METH_CLASS or METH_STATIC
というエラーが出できます。ちなみにランタイムをNoneにするとエラーなく実行することができます。解決方法をお願いします
(追加)
!nvidia-smi ---------------------- Fri Nov 19 04:30:01 2021 +-----------------------------------------------------------------------------+ | NVIDIA-SMI 495.44 Driver Version: 460.32.03 CUDA Version: 11.2 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |===============================+======================+======================| | 0 Tesla K80 Off | 00000000:00:04.0 Off | 0 | | N/A 60C P0 59W / 149W | 145MiB / 11441MiB | 0% Default | | | | N/A | +-------------------------------+----------------------+----------------------+ +-----------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=============================================================================| | No running processes found | +-----------------------------------------------------------------------------+
!pip freeze ------------------------------ WARNING: Ignoring invalid distribution -orch (/usr/local/lib/python3.7/dist-packages) torch==1.7.0+cu101 torchaudio==0.7.0 torchsummary==1.5.1 torchtext==0.11.0 torchvision==0.8.1+cu101 (文字数制限のため省略しました)
回答1件
あなたの回答
tips
プレビュー