question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hi! Tell me please, how can I train your model on my data set with a different number of classes? I created a dataset the same as the directory structure of the dasset PASCAL_VOC. Then, I changed the path to the dataset and the number of classes in the configuration file. num_classes = 1

But, i get an error:

/opt/conda/conda-bld/pytorch-nightly_1551849226410/work/aten/src/THC/THCTensorScatterGather.cu:97: void THCudaTensor_gatherKernel(TensorInfo<Real, IndexType>, TensorInfo<Real, IndexType>, TensorInfo<long, IndexType>, int, IndexType) [with IndexType = unsigned int, Real = float, Dims = 2]: block: [273,0,0], thread: [353,0,0] Assertion indexValue >= 0 && indexValue < src.sizes[dim] failed. /opt/conda/conda-bld/pytorch-nightly_1551849226410/work/aten/src/THC/THCTensorScatterGather.cu:97: void THCudaTensor_gatherKernel(TensorInfo<Real, IndexType>, TensorInfo<Real, IndexType>, TensorInfo<long, IndexType>, int, IndexType) [with IndexType = unsigned int, Real = float, Dims = 2]: block: [271,0,0], thread: [225,0,0] Assertion indexValue >= 0 && indexValue < src.sizes[dim] failed. /opt/conda/conda-bld/pytorch-nightly_1551849226410/work/aten/src/THC/THCTensorScatterGather.cu:97: void THCudaTensor_gatherKernel(TensorInfo<Real, IndexType>, TensorInfo<Real, IndexType>, TensorInfo<long, IndexType>, int, IndexType) [with IndexType = unsigned int, Real = float, Dims = 2]: block: [204,0,0], thread: [147,0,0] Assertion indexValue >= 0 && indexValue < src.sizes[dim] failed. nightly_1551849226410/work/aten/src/THC/THCTensorScatterGather.cu:97: void THCudaTensor_gatherKernel(TensorInfo<Real, IndexType>, TensorInfo<Real, IndexType>, TensorInfo<long, IndexType>, int, IndexType) [with IndexType = unsigned int, Real = float, Dims = 2]: block: [31,0,0], thread: [61,0,0] Assertion indexValue >= 0 && indexValue < src.sizes[dim] failed. Traceback (most recent call last): File “train.py”, line 104, in <module> loss_l, loss_c = criterion(out, priors, targets) File “/home/maksim/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py”, line 491, in call result = self.forward(*input, **kwargs) File “/mnt/data/code/object_detection/M2Det/layers/modules/multibox_loss.py”, line 95, in forward loss_c[pos.view(-1,1)] = 0 # filter out pos boxes for now RuntimeError: copy_if failed to synchronize: device-side assert triggered

I would be grateful for any help

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:16

github_iconTop GitHub Comments

9reactions
Maxfashkocommented, Apr 2, 2019

@ufohuang98 I could not fix this problem. It seems the developers need to pay attention to this problem, and explain why this is happening and how to solve it. @dshahrokhian we can hope to get clear explanations from you about this problem? Or do you prefer to leave us alone with this problem? 😃

3reactions
lonlcommented, Apr 22, 2019

@dshahrokhian @Maxfashko @DeqiangWang @Xiehuaiqi @ufohuang98 @rw1995 maybe you should adjust the weights between “loss_l” and “loss_c”, you could find “loss = loss_l + loss_c” in “train.py” of this project, and you can introduce a parameter lambda to change the loss, like “loss = loss_l + 0.1*loss_c”, finally, you may get the correct results~

Read more comments on GitHub >

github_iconTop Results From Across the Web

4 Creating Custom Classes
Creating a custom class is the most basic Oracle iFS customization. Other ways to customize Oracle iFS include writing custom parsers, renderers, JSPs, ......
Read more >
How to Create Custom Class in Java? - GeeksforGeeks
How to Create Custom Class in Java? ... Class is the collection of objects. Class is not a real-world entity it is just...
Read more >
What is the meaning of the term "Custom Class"?
A Custom Class is a developer defined class, based on one of the stock classes (classes built-in to dBASE). A really good example...
Read more >
Simple Steps for Creating Your Own Class in Python
Learn what a custom class is in Python and discover how to create classes and custom objects in Python.
Read more >
Custom Classes - Shmoop
Subscribe Getting Started Class Schedule Maker What are Custom Classes? J.K. Rowling might not be thrilled if you decided the Harry Potter books...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found