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

如果我要训练自己的数据集,除了config文件里面要改动相应的clss,别的地方还有哪里要更改吗 #19

Open
wubalahao opened this issue Aug 31, 2023 · 4 comments

Comments

@wubalahao
Copy link

No description provided.

@LiWentomng
Copy link
Owner

@wubalahao Sorry to rely late.
是的, 只需要修改配置文件中的 class,就可以训练。 可以先训练看看结果,再考虑进一步调整一些参数。

@ZHIZIHUABU
Copy link

代码基于mmdet库运行,mmdet里面的class_names也是要修改的

@wubalahao
Copy link
Author

是这样的我根据老哥的建议换成了自己的数据集也跑通了,但是发现了一个奇怪的bug,就是我在不改变这个文件里的类别名字的时候数据读取是正常的如下:
image
但是我一旦更改乐这个文件里面的类别名字就会
image
出现读取错误的问题,这个我搞了一会也没搞明白是啥问题

@wubalahao
Copy link
Author

还有就算可以正常训练,每到第二个epoch就会训练停止出现以下错误

2024-01-28 10:54:54,173 - mmdet - INFO - Epoch [2][750/2800] lr: 5.000e-03, eta: 9:17:20, time: 0.338, data_time: 0.004, memory: 4121, loss_cls: nan, loss_bbox: nan, loss_centerness: nan, loss_prj: nan, loss_pairwise: nan, loss: nan
Traceback (most recent call last):
File "tools/train.py", line 257, in
main()
File "tools/train.py", line 245, in main
train_detector(
File "/mnt/d/deeplearning/wh/boxinstseg1/boxinstseg/mmdet/apis/train.py", line 244, in train_detector
runner.run(data_loaders, cfg.workflow)
File "/home/wubala/down/yes/envs/boxseg/lib/python3.8/site-packages/mmcv/runner/epoch_based_runner.py", line 127, in run
epoch_runner(data_loaders[i], **kwargs)
File "/home/wubala/down/yes/envs/boxseg/lib/python3.8/site-packages/mmcv/runner/epoch_based_runner.py", line 50, in train
self.run_iter(data_batch, train_mode=True, **kwargs)
File "/home/wubala/down/yes/envs/boxseg/lib/python3.8/site-packages/mmcv/runner/epoch_based_runner.py", line 29, in run_iter
outputs = self.model.train_step(data_batch, self.optimizer,
File "/home/wubala/down/yes/envs/boxseg/lib/python3.8/site-packages/mmcv/parallel/data_parallel.py", line 75, in train_step
return self.module.train_step(*inputs[0], **kwargs[0])
File "/mnt/d/deeplearning/wh/boxinstseg1/boxinstseg/mmdet/models/detectors/base.py", line 248, in train_step
losses = self(**data)
File "/home/wubala/down/yes/envs/boxseg/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
return forward_call(*input, **kwargs)
File "/home/wubala/down/yes/envs/boxseg/lib/python3.8/site-packages/mmcv/runner/fp16_utils.py", line 110, in new_func
return old_func(*args, **kwargs)
File "/mnt/d/deeplearning/wh/boxinstseg1/boxinstseg/mmdet/models/detectors/base.py", line 172, in forward
return self.forward_train(img, img_metas, **kwargs)
File "/mnt/d/deeplearning/wh/boxinstseg1/boxinstseg/mmdet/models/detectors/condinst.py", line 69, in forward_train
param_pred, coors, level_inds, img_inds, gt_inds = self.mask_head.training_sample(
File "/mnt/d/deeplearning/wh/boxinstseg1/boxinstseg/mmdet/models/dense_heads/condinst_head.py", line 1225, in training_sample
sampled_inds = torch.cat(sampled_inds, dim=0)
NotImplementedError: There were no tensor arguments to this function (e.g., you passed an empty list of Tensors), but no fallback function is registered for schema aten::_cat. This us
ually means that this function requires a non-empty list of Tensors, or that you (the operator writer) forgot to register a fallback function. Available functions are [CPU, CUDA, Quan
tizedCPU, BackendSelect, Named, ADInplaceOrView, AutogradOther, AutogradCPU, AutogradCUDA, AutogradXLA, UNKNOWN_TENSOR_TYPE_ID, AutogradMLC, AutogradHPU, AutogradNestedTensor, AutogradPrivateUse1, AutogradPrivateUse2, AutogradPrivateUse3, Tracer, Autocast, Batched, VmapMode].

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

3 participants