LoginSignup
0
1

More than 1 year has passed since last update.

pytorchインストール時のnumpyエラー

Posted at

numpyエラーで詰まったので解消備忘録

こちらの記事に従ってubuntuにGPU環境作成時にnumpyのエラー発生。

エラー内容

ERROR: Could not install packages due to an OSError:
[Errno 2] No such file or directory: 
'/home/username/espnet/tools/miniconda/envs/espnet/
lib/python3.8/site-packages/numpy-1.24.3.dist-info/METADATA'

解決策はこちらのissuesにありました。

該当ファイルを削除し、numpyをインストールしなおしてpytorchを入れるといけるっぽい

pip3 uninstall numpy
pip3 install numpy==1.23

pip3 install torch==1.8.2+cu111 torchvision==0.9.2+cu111 to
rchaudio===0.8.2 -f https://download.pytorch.org/whl/lts/1.8/torch_lts.html
>> killed

killedされて入らない。。。。。

--no-cache-dirをつけるといいらしい。

pip3 --no-cache-dir install torch==1.8.2+cu111 torchvision==0.9.2+cu111 to
rchaudio===0.8.2 -f https://download.pytorch.org/whl/lts/1.8/torch_lts.html

無事インストールが通りました

一応確認

python
>> import torch
>> print(torch.cuda.is_available())
True

Trueが帰ってきてGPUが使える状態になりました。

参考

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1