Issues when running the code in Colab #7841
Unanswered
Jose-Augusto-C-M
asked this question in
Q&A
Replies: 3 comments
-
I came up with the same trouble. API:def build_dp(model, device='cuda', dim=0, *args, **kwargs): |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thank you bro or sister 😅, I will come back to investigate the issues with
my code, there's some time that i don't revisit this demand.
But very fucking thank you for you help. 🖖
…On Wed, Apr 27, 2022, 19:56 12567878 ***@***.***> wrote:
I came up with the same trouble.
In mmdet/apis/train.py:163 change it to:
model = build_dp(model, device_ids=cfg.gpu_ids) # delete parameter
cfg.device,it will work.
API:def build_dp(model, device='cuda', dim=0, *args, **kwargs):
Passing cfg.device='cuda' may work,too.
—
Reply to this email directly, view it on GitHub
<#7841 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIZQTU6U4LOYE6FVDQPBYN3VHF5WBANCNFSM5UODPWRQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi, I cam across the same issue. I was bale to resolve it be setting |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, first I would like to thank you guys for all the hard work put in mmlab in general, It´s an amazing contribution.
For the error, I´m try to run the codes: '[MMDet_InstanceSeg_Tutorial.ipynb] and [MMDet_Tutorial.ipynb]' on colab, in both I´m facing an error when running this part of the code:
'
from mmdet.datasets import build_dataset
from mmdet.models import build_detector
from mmdet.apis import train_detector
Build dataset
datasets = [build_dataset(cfg.data.train)]
Build the detector
model = build_detector(cfg.model)
Add an attribute for visualization convenience
model.CLASSES = datasets[0].CLASSES
Create work_dir
mmcv.mkdir_or_exist(osp.abspath(cfg.work_dir))
train_detector(model, datasets, cfg, distributed=False, validate=True)
'
The result of the code is:
'
loading annotations into memory...
Done (t=0.01s)
creating index...
index created!
AttributeError Traceback (most recent call last)
in ()
15 # Create work_dir
16 mmcv.mkdir_or_exist(osp.abspath(cfg.work_dir))
---> 17 train_detector(model, datasets, cfg, distributed=False, validate=True)
2 frames
/content/mmdetection/mmdet/apis/train.py in train_detector(model, dataset, cfg, distributed, validate, timestamp, meta)
161 find_unused_parameters=find_unused_parameters)
162 else:
--> 163 model = build_dp(model, cfg.device, device_ids=cfg.gpu_ids)
164
165 # build optimizer
/usr/local/lib/python3.7/dist-packages/mmcv/utils/config.py in getattr(self, name)
511
512 def getattr(self, name):
--> 513 return getattr(self._cfg_dict, name)
514
515 def getitem(self, name):
/usr/local/lib/python3.7/dist-packages/mmcv/utils/config.py in getattr(self, name)
47 else:
48 return value
---> 49 raise ex
50
51
AttributeError: 'ConfigDict' object has no attribute 'device'
'
This happens when using the exact code from the demo, I did not change anything. What should I do?
Beta Was this translation helpful? Give feedback.
All reactions