lyuwenyu / RT-DETR

[CVPR 2024] Official RT-DETR (RTDETR paddle pytorch), Real-Time DEtection TRansformer, DETRs Beat YOLOs on Real-time Object Detection. 🔥 🔥 🔥
Apache License 2.0
2.61k stars 303 forks source link

Import error of datapoints #416

Open Subhankhan41 opened 3 months ago

Subhankhan41 commented 3 months ago

Hi,

I tried from torchvision import data points and also from torchvision.prototype import datapoints, but I am still having ImportError: cannot import name 'datapoints' from 'torchvision' and ImportError: cannot import name 'datapoints' from 'torchvision.prototype respectively. The rest of things are working fine including from torchvision.prototype import transforms as T. Any idea why it's happening?

from torchvision.prototype import transforms as T from torchvision.prototype import datapoints

ImportError: cannot import name 'datapoints' from 'torchvision.prototype' (C:\Users\Subhan.Khan\AppData\Local\anaconda3\envs\myconda\Lib\site-packages\torchvision\prototypeinit.py)

from torchvision.prototype import transforms as T from torchvision import datapoints

ImportError: cannot import name 'datapoints' from 'torchvision'

lyuwenyu commented 3 months ago

You can use rtdetrv2_pytorch, otherwise your packages must match corresponding version.

https://github.com/lyuwenyu/RT-DETR/blob/bc0cf9f16c1ae98e925a7495e32c81319a624088/rtdetr_pytorch/requirements.txt#L1-L2

anewcatwhy commented 2 months ago

Hi, 你好

I tried from torchvision import data points and also from torchvision.prototype import datapoints, but I am still having ImportError: cannot import name 'datapoints' from 'torchvision' and ImportError: cannot import name 'datapoints' from 'torchvision.prototype respectively. The rest of things are working fine including from torchvision.prototype import transforms as T. Any idea why it's happening?我尝试从 torchvision 导入数据点,也尝试从 torchvision.prototype 导入数据点,但我仍然遇到 ImportError:无法从 'torchvision' 导入名称 'datapoints' 和 ImportError:无法分别从 'torchvision.prototype' 导入名称 'datapoints'。其余事情都工作正常,包括从 torchvision.prototype 导入转换为 T。知道为什么会这样吗?

from torchvision.prototype import transforms as T from torchvision.prototype import datapoints从 torchvision.prototype 导入数据点

ImportError: cannot import name 'datapoints' from 'torchvision.prototype' (C:\Users\Subhan.Khan\AppData\Local\anaconda3\envs\myconda\Lib\site-packages\torchvision\prototypeinit.py)ImportError:无法从“torchvision.prototype”导入名称“数据点”(C:\Users\Subhan.Khan\AppData\Local\anaconda3\envs\myconda\Lib\site-packages\torchvision\prototypeinit.py)

from torchvision.prototype import transforms as T from torchvision import datapoints从 torchvision 导入数据点

ImportError: cannot import name 'datapoints' from 'torchvision'ImportError:无法从“torchvision”导入名称“datapoints”

excuse me ,do you solve it with the author's ways

anewcatwhy commented 2 months ago

it is solved