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
Launch train with custom dataset - Invalid index in scatter at .. #68
Comments
Hey I think you have to properly specify the location of --label_dir --image_dir and instance_dir. You can use --dataroot to make it easier. |
Hi @aviel08 thanks for the answer. Unfortunately it doesn't seem to work, when I use In any case I made some progress and I've been able to make it work for
But with my custom dataset I still haven't been able to make it work: debuggin the code I saw that the labels generated in my code are ( |
Well first thing you should try is using the provided dataset to test it first and then you can use your own data. Make sure you're specify the location of each folder for --label_dir and --image_dir. Then specify --label_nc, which is 182 for coco_stuff, this is the default anyway but it's a good practice since you'll have to write the number of your labels anyway. Your command should be: python train.py --name [name_of_experiment] --dataset_mode custom --label_dir [path_to_labels] -- image_dir [path_to_images] --label_nc [num_labels] |
@aviel08 Thanks again for your suggestions. The fact is that for the provided dataset everything works fine even if I use it with the In your last comment you wrote that |
So you narrowed it down to your dataset, it has to be like the ones on the sample, same format. |
Yes that's exactly what I tried, but I'm still getting the error
I'm also trying to use the label_map generated from the coco dataset with the input_label_map generated from my dataset but still no luck |
Alright, out of curiosity. What happens when you set a really high value
like - - label_nc 200 or 300?
…On Wed, 31 Jul. 2019, 1:09 am Luca Grazioli, ***@***.***> wrote:
Yes that's exactly what I tried, but I'm still getting the error
RuntimeError: Invalid index in scatter at /pytorch/aten/src/TH/generic/THTensorEvenMoreMath.cpp:551
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#68?email_source=notifications&email_token=ABA62PFZ3RP74YUCX7ZJ36DQCBKSLA5CNFSM4IHTGVCKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3EJM5Q#issuecomment-516462198>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABA62PHWJ34IAKWI5TDLYZTQCBKSLANCNFSM4IHTGVCA>
.
|
It seems to work! Wow 😮 This is the command I used:
|
Hmmm I've had this same problem before with some of my own dataset as well
and I suspect it's related to the format of the label images. I actually
would like to know why this happens.
…On Wed, 31 Jul. 2019, 1:14 am Luca Grazioli, ***@***.***> wrote:
It seems to work! Wow 😮
Any clue of the reason why it worked?
This is the command I used:
python train.py --name REDACTED --dataset_mode custom --label_dir REDACTED --image_dir REDACTED --instance_dir REDACTED --label_nc 200 --contain_dontcare_label --gpu_ids -1
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#68?email_source=notifications&email_token=ABA62PBX3VDMRE66X5HIYM3QCBLGNA5CNFSM4IHTGVCKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3EJ6EI#issuecomment-516464401>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABA62PDKAH73PJQ3XE75Q4LQCBLGNANCNFSM4IHTGVCA>
.
|
Good to know, but it seems like a bug: the label_nc number that I set is not correct given the dataset that I have. I tried to debug it and my guess is that there's something in the dataloader |
thanks for the awesome work you've done! |
I have the same error in another project. I could not find a solution for it. I appreciate your help. I have asked the question at michuanhaohao/reid-strong-baseline#120 |
I met the same problem that you mentioned, and it worked after I used the command: but I still don't know why it worked, but the key point is "label_nc". And I have seen the another answer, said we need to set a large value of this parameter, such as 200 or 300, the classes of my custom dataset is 9, then it worked.. |
@Sonatau what are you using for the labels and the instance maps? I am using rgb masks for labels and grayscale type maps for the instance parameter and getting cuda errors |
Hi @mjehanzaib999, according to the label map, you should convert the segmentation mask (H, W, 3) to a grey label (H, W) firstly. For example, in the label map, we have id 1 mapping to rgb (22, 33, 11). if there is a pixel in mask belongs to rgb (22, 33, 11), the corresponding position in label should be 1. |
the same issue, when i set larger label_nc, ok |
~*><*~邮件已收到!
|
Hi all,
thanks for the awesome work you've done!
I'm trying to launch a new train with a custom dataset I've generated using the
custom_dataset
option in training.My dataset is composed of 2 classes with a background, considering the background there are 3 classes overall.
I'm trying to stick with the simplest launch configuration, but I'm always getting the same error
I also tried to launch the same code with the
coco_stuff
folder but used as a custom dataset and I'm getting the same error.I'm pretty sure that this is due sto some config option that I'm missing.
Can you guys give me any clue of what's happening?
Thanks!
The text was updated successfully, but these errors were encountered: