Giter Club home page Giter Club logo

Comments (2)

michaelklachko avatar michaelklachko commented on July 17, 2024

Ok, so it seems like it expects val images to be in folders per class, as explained here: https://github.com/pytorch/examples/tree/master/imagenet

Yet I still get the following "Assertion t >= 0 && t < n_classes failed" error:

/opt/conda/conda-bld/pytorch_1532579245307/work/aten/src/THCUNN/ClassNLLCriterion.cu:105: void cunn_ClassNLLCriterion_updateOutput_kernel(Dtype *, Dtype *, Dtype *, long *, Dtype *, int, int, int, int, long) [with Dtype = float, Acctype = float]: block: [0,0,0], thread: [31,0,0] Assertion `t >= 0 && t < n_classes` failed.
Traceback (most recent call last):
  File "main.py", line 64, in <module>
    main()
  File "main.py", line 51, in main
    loss_train = trainer.train(epoch, loaders)
  File "/home/michael/pytorchnet/train.py", line 138, in train
    loss.backward()
  File "/home/michael/miniconda2/envs/pt/lib/python3.6/site-packages/torch/tensor.py", line 93, in backward
    torch.autograd.backward(self, gradient, retain_graph, create_graph)
  File "/home/michael/miniconda2/envs/pt/lib/python3.6/site-packages/torch/autograd/__init__.py", line 90, in backward
    allow_unreachable=True)  # allow_unreachable flag
RuntimeError: cuda runtime error (59) : device-side assert triggered at /opt/conda/conda-bld/pytorch_1532579245307/work/aten/src/THC/generic/THCTensorMath.cu:26
NoneType: None

I can run https://github.com/pytorch/examples/blob/master/imagenet/main.py just fine, so must be something missing in your code...

from pytorchnet.

michaelklachko avatar michaelklachko commented on July 17, 2024

Oh, I forgot to change number of classes in args file, my bad!

from pytorchnet.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.