Giter Site home page Giter Site logo

Question: Training error about sgan HOT 8 CLOSED

agrimgupta92 avatar agrimgupta92 commented on August 22, 2024 1
Question: Training error

from sgan.

Comments (8)

angeliand avatar angeliand commented on August 22, 2024 3

You should most likely make noise_dim equal to 0 with the command line flags (--noise_dim=0).

The error occurs because as you can see in this line of code : if self.noise_dim[0] == 0: noise_dim gets indexed. However the default value for noise_dim (see TRAINING.MD for this) is None, which cannot be indexed. Arrays, lists, etc. can be.

It's a slight inconvenience in the code which could be avoided by making the default value 0.

from sgan.

w00zie avatar w00zie commented on August 22, 2024 1

I don't want to

make noise_dim equal to 0 with the command line flags

as @angeliand pointed out.
I want to add noise while training, as @agrimgupta92 did while training his models.
I used his script print_args.py and noticed how he consistently trained with noise_dim = 8. I've tried to add noise with --noise_dim 8 but that resulted in this error:

Traceback (most recent call last):
  File "scripts/train.py", line 643, in <module>
    main(args)
  File "scripts/train.py", line 271, in main
    optimizer_d)
  File "scripts/train.py", line 399, in discriminator_step
    generator_out = generator(obs_traj, obs_traj_rel, seq_start_end)
  File "anaconda3/envs/progetto/lib/python3.6/site-packages/torch/nn/modules/module.py", line 489, in __call__
    result = self.forward(*input, **kwargs)
  File "sgan/sgan/models.py", line 587, in forward
    seq_start_end,
  File "anaconda3/envs/progetto/lib/python3.6/site-packages/torch/nn/modules/rnn.py", line 175, in forward
    self.check_forward_args(input, hx, batch_sizes)
  File "anaconda3/envs/progetto/lib/python3.6/site-packages/torch/nn/modules/rnn.py", line 152, in check_forward_args
    'Expected hidden[0] size {}, got {}')
  File "anaconda3/envs/progetto/lib/python3.6/site-packages/torch/nn/modules/rnn.py", line 148, in check_hidden_size
    raise RuntimeError(msg.format(expected_hidden_size, tuple(hx.size())))
  • Is there something that I'm missing or it can be considered a bug?
  • Training with noise_dim = 0 leads to a model trained on real data only (with no added noise at all) ?

Thanks.

from sgan.

daehoumich avatar daehoumich commented on August 22, 2024

TypeError: 'NoneType' object is not subscriptable

from sgan.

rowanmcallister avatar rowanmcallister commented on August 22, 2024

Why was this issue closed, without fixing the code?

I ran into the same issue 4 months on.

from sgan.

mingbocui avatar mingbocui commented on August 22, 2024

@w00zie Hi, have you solved this problem? I also want to train with non-zero noise-dim, thanks in advance!

from sgan.

mingbocui avatar mingbocui commented on August 22, 2024

@w00zie seems that I could run the code now, just change (8,0) to 8

from sgan.

w00zie avatar w00zie commented on August 22, 2024

@mingbocui you mean --noise_dim 8 or --noise_dim (8,0)?
Thank you

from sgan.

mingbocui avatar mingbocui commented on August 22, 2024

@w00zie just use --noise_dim 8

from sgan.

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.