Code Monkey home page Code Monkey logo

Comments (2)

rollysys avatar rollysys commented on June 8, 2024

The main.py is not a complete example code, it's some code snippets.
You shoud implement your own "custom data loader", refer to torchvision.datasets.CIFAR10.
Your error is caused by null implementation of CustomDataset.

from pytorch-tutorial.

lsnnt avatar lsnnt commented on June 8, 2024
nnt@mycomp:~/pytorch-tutorial/tutorials/01-basics/pytorch_basics$ python3 main.py 
tensor(2.)
tensor(1.)
tensor(1.)
w:  Parameter containing:
tensor([[-0.0246,  0.4567, -0.4118],
        [ 0.1679, -0.5086, -0.3876]], requires_grad=True)
b:  Parameter containing:
tensor([0.0529, 0.2922], requires_grad=True)
loss:  1.949414610862732
dL/dw:  tensor([[-0.7870,  1.5242, -0.0795],
        [ 0.8206, -0.9073, -0.7711]])
dL/db:  tensor([-0.5564,  0.0907])
loss after 1 step optimization:  1.896445631980896
Files already downloaded and verified
torch.Size([3, 32, 32])
6
Traceback (most recent call last):
  File "/home/nnt/pytorch-tutorial/tutorials/01-basics/pytorch_basics/main.py", line 124, in <module>
    images, labels = data_iter.next()
AttributeError: '_SingleProcessDataLoaderIter' object has no attribute 'next'

Also this

from pytorch-tutorial.

Related Issues (20)

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.