yolov5’s detect.py debugging error record

1. ImportError: cannot import name ‘Image’ from ‘PIL’ (unknown location)

Solution: ReinstallPillowmodule

pip uninstall Pillow
pip install Pillow

2. ModuleNotFoundError: No module named ‘yaml’

Obviously it has been doneconda install yaml but an error is still reported.
Reason: The pip toolkit name of the yaml module is not yaml, but pyyaml, so instead of pip install yaml directly, pip install pyyaml is used.

3. ModuleNotFoundError: No module named ‘matplotlib.pyplot’

Solution: Use the following three instructions

pip uninstall matplotlib
pip install jupyter
pip install matplotlib

4. ModuleNotFoundError: No module named ‘packaging’

There is already packaging here but an error is still reported. The solution is to uninstall first and then install

5. AttributeError: ‘Upsample’ object has no attribute ‘recompute_scale_factor’

Solution:
Find the path: The file under Find the forward function and make the following modifications: a>D:\Users\JMan\anaconda3\envs\yolov5\Lib\site-packages\torch\nn\modulesupsampling.py
Insert image description here

Guess you like

Origin blog.csdn.net/weixin_45246566/article/details/129162976