wenquanlu / HandRefiner

MIT License
701 stars 30 forks source link

No module named 'torch._custom_ops' #34

Closed neonarc4 closed 3 weeks ago

neonarc4 commented 4 weeks ago


Z:\testf\HandRefiner>python handrefiner.py --input_img test/1.jpg --out_dir output --strength 0.55 --weights models/inpaint_depth_control.ckpt --prompt "a man facing the camera, making a hand gesture, indoor" --seed 1
Traceback (most recent call last):
  File "Z:\testf\HandRefiner\handrefiner.py", line 24, in <module>
    from torchvision import transforms
  File "Z:\software\python\lib\site-packages\torchvision\__init__.py", line 6, in <module>
    from torchvision import _meta_registrations, datasets, io, models, ops, transforms, utils
  File "Z:\software\python\lib\site-packages\torchvision\_meta_registrations.py", line 4, in <module>
    import torch._custom_ops
ModuleNotFoundError: No module named 'torch._custom_ops'
wenquanlu commented 4 weeks ago

Hi, seems you don't have compatible versions between torch and torchvision You can try to uninstall and re-install torchvision or upgrade torch/torchvision

you can try

pip uninstall torchvision
pip install torchvision

Some available solutions online: https://www.reddit.com/r/pytorch/comments/1cl3set/no_module_named_torch_custom_ops/

neonarc4 commented 3 weeks ago

thank you