Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

about torch version and requirements #18

Open
lzytor opened this issue Apr 20, 2021 · 4 comments
Open

about torch version and requirements #18

lzytor opened this issue Apr 20, 2021 · 4 comments

Comments

@lzytor
Copy link

lzytor commented Apr 20, 2021

Hi,我在anachonda3中完成环境配置,尝试运行detect.py时遇到了以下问题,这些问题可能来源于torch版本或者其他的冲突
CUDA=10.0, cudnn=7.6.5, python=3.7, opencv-python=4.2.0.34
测试环境1:torch=1.6, torchvision=0.7, 其他包均从requirement.txt文件安装,运行detect.py报错:
TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.

测试环境2:torch=1.7, torchvision=0.8.1, 其他包均遵从U版yolov5 requirement.txt,降低opencv-python版本至4.2。i.e.标准yolov5环境,并测试通过yolov5。加装shapely。运行detect.py报错:
torch.nn.modules.module.ModuleAttributeError: 'Hardswish' object has no attribute 'inplace'
根据网上说法,这个问题需将torch降低至1.6,所以该问题死循环了。

@wenyishengkingkong
Copy link

我也遇到了上面同样的问题,不知道该如何解答

@sunbuhui
Copy link

@littlelight-e
Copy link

同样,将torch降到1.6则显示和我的显卡版本不匹配,使用更高级别的也不能使用

@sunbuhui
Copy link

@littlelight-e Browse my pasted issue above, and modify PyTorch's source code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants