ImportError: cannot import name '_new_empty_tensor' from 'torchvision.ops'
Dawn-LX opened this issue · comments
Kephone Gaon commented
A small tip, in case the future researcher have the similar issue.
my torchvision.__version__
is "0.12.0+cu113"
and this line
Line 14 in 71c5702
should be modified as:
# if float(torchvision.__version__[:3]) < 0.7:
if int(torchvision.__version__.split('.')[1]) < 7: # my torchvision.__version__ is "0.12.0+cu113"
from torchvision.ops import _new_empty_tensor
from torchvision.ops.misc import _output_size
Yue Liao commented
Yes, that's right.