Pytorch がインストールできない
解決したいこと
YOLOv5でヒートマップを実装できるとのことで
githubからひっぱってきました。
git clone https://github.com/akarasman/yolo-heatmaps/
READMEの通りに進めて、
python3 explain.py --source=data/images/so-and-so.jpg --weights=yolov5s.pt --explain-class='person'
を実行したところ
ImportError: cannot import name 'QuantStub' from 'torch.ao.quantization'
とでてきました。調べるとPytorchのバージョンがあってないとのことなので
pip install pytorch
とするとなぜかインストールができません。
エラー文章です
Defaulting to user installation because normal site-packages is not writeable
Collecting pytorch
Using cached pytorch-1.0.2.tar.gz (689 bytes)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: pytorch
Building wheel for pytorch (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [6 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/tmp/pip-install-hpr9zymv/pytorch_7cc9c500445140c1bb2d463322a51c2d/setup.py", line 15, in <module>
raise Exception(message)
Exception: You tried to install "pytorch". The package named for PyTorch is "torch"
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pytorch
Running setup.py clean for pytorch
Failed to build pytorch
Installing collected packages: pytorch
Running setup.py install for pytorch ... error
error: subprocess-exited-with-error
× Running setup.py install for pytorch did not run successfully.
│ exit code: 1
╰─> [6 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/tmp/pip-install-hpr9zymv/pytorch_7cc9c500445140c1bb2d463322a51c2d/setup.py", line 11, in <module>
raise Exception(message)
Exception: You tried to install "pytorch". The package named for PyTorch is "torch"
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> pytorch
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
強制的にインストールするコマンドでインストールするとせっかくつくった環境が壊れてしまいます。
どうしたらこの問題を解決できるのでしょうか。
0