Giter Site home page Giter Site logo

Comments (3)

Jakaria08 avatar Jakaria08 commented on August 22, 2024

Hi,

After setting worker = 0, I got new error:

"ValueError: Expected more than 1 value per channel when training, got input size [1, 512, 1, 1]"

Traceback (most recent call last):

File "", line 1, in
runfile('C:/Users/jakaria/DEXTR-PyTorch/train_pascal.py', wdir='C:/Users/jakaria/DEXTR-PyTorch')

File "C:\Users\jakaria\AppData\Local\conda\conda\envs\tensorflow\lib\site-packages\spyder\utils\site\sitecustomize.py", line 705, in runfile
execfile(filename, namespace)

File "C:\Users\jakaria\AppData\Local\conda\conda\envs\tensorflow\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)

File "C:/Users/jakaria/DEXTR-PyTorch/train_pascal.py", line 148, in
output = net.forward(inputs)

File "C:\Users\jakaria\DEXTR-PyTorch\networks\deeplab_resnet.py", line 196, in forward
x = self.layer5(x)

File "C:\Users\jakaria\AppData\Local\conda\conda\envs\tensorflow\lib\site-packages\torch\nn\modules\module.py", line 357, in call
result = self.forward(*input, **kwargs)

File "C:\Users\jakaria\DEXTR-PyTorch\networks\deeplab_resnet.py", line 118, in forward
priors = [F.upsample(input=stage(feats), size=(h, w), mode='bilinear') for stage in self.stages]

File "C:\Users\jakaria\DEXTR-PyTorch\networks\deeplab_resnet.py", line 118, in
priors = [F.upsample(input=stage(feats), size=(h, w), mode='bilinear') for stage in self.stages]

File "C:\Users\jakaria\AppData\Local\conda\conda\envs\tensorflow\lib\site-packages\torch\nn\modules\module.py", line 357, in call
result = self.forward(*input, **kwargs)

File "C:\Users\jakaria\AppData\Local\conda\conda\envs\tensorflow\lib\site-packages\torch\nn\modules\container.py", line 67, in forward
input = module(input)

File "C:\Users\jakaria\AppData\Local\conda\conda\envs\tensorflow\lib\site-packages\torch\nn\modules\module.py", line 357, in call
result = self.forward(*input, **kwargs)

File "C:\Users\jakaria\AppData\Local\conda\conda\envs\tensorflow\lib\site-packages\torch\nn\modules\batchnorm.py", line 37, in forward
self.training, self.momentum, self.eps)

File "C:\Users\jakaria\AppData\Local\conda\conda\envs\tensorflow\lib\site-packages\torch\nn\functional.py", line 1011, in batch_norm
raise ValueError('Expected more than 1 value per channel when training, got input size {}'.format(size))

ValueError: Expected more than 1 value per channel when training, got input size [1, 512, 1, 1]

from dextr-pytorch.

Jakaria08 avatar Jakaria08 commented on August 22, 2024

I have 4 gb nvidia gtx 1050 GPU. Is it ok to train with that? can I reduce batch size to 1?

from dextr-pytorch.

scaelles avatar scaelles commented on August 22, 2024

Hello, you cannot use batch size 1 when training (refer to this issue). Therefore, batch size has to be at least 2. Morevoer, if len(train_set) % batch_size =1 you will encounter the same error. Just write in line 142 of train_pascal.py:

if inputs.shape[0] == 1:
    continue

Let us know if that fixes your problem.

from dextr-pytorch.

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.