Coder Social home page Coder Social logo

capsnet_pytorch's Introduction

capsnet_pytorch's People

Contributors

alexhex7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

capsnet_pytorch's Issues

Error on RGB images or channel 3

I want to try to implement your code on RGB images where I got the following errors. Can you help me to sort out the problem please?

transform = transforms.Compose([
transforms.Resize((28,28)),
transforms.Grayscale(num_output_channels=3),
transforms.ToTensor(),
transforms.Normalize((0.1307,), (0.3081,))])

File "main.py", line 117, in
predict, reconstruct_img = net(img_batch, label_batch, train=True)
File "/home/user/pytorch_python3/lib/python3.5/site-packages/torch/nn/modules/module.py", line 224, in call
result = self.forward(*input, **kwargs)
File "/media/user/DATA/New_CODE/Working/CapsNet_pytorch/lib/network.py", line 45, in forward
output = self.conv1(x)
File "/home/user/pytorch_python3/lib/python3.5/site-packages/torch/nn/modules/module.py", line 224, in call
result = self.forward(*input, **kwargs)
File "/home/user/pytorch_python3/lib/python3.5/site-packages/torch/nn/modules/conv.py", line 254, in forward
self.padding, self.dilation, self.groups)
File "/home/user/pytorch_python3/lib/python3.5/site-packages/torch/nn/functional.py", line 52, in conv2d
return f(input, weight, bias)
RuntimeError: Need input.size[1] == 1 but got 3 instead.

Error on USPS dataset.

I would like to thank you so much for this code. You did a great job.

Actually I wanted to implement this code on USPS dataset. I am using the data loading code.

https://github.com/corenel/torchzoo/blob/master/torchzoo/datasets/usps.py

USPS

train_dataset = USPS('/media/DL/DATA/New_CODE/Working/CapsNet_pytorch/USPS', train=True, transform=None, download=False)
test_dataset = USPS('/media/DL/DATA/New_CODE/Working/CapsNet_pytorch/USPS', train=False, transform=None, download=False)
But got the following error.
RuntimeError: Need input.size[1] == 1 but got 28 instead.

Can you help me to sort out the problem please? Thanks in advanced.

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.