Git Product home page Git Product logo

Comments (2)

gaopeng-eugene avatar gaopeng-eugene commented on September 26, 2024

when I run the demo code, I run into the following error.
/opt/data/penggao/pytorch_project/clevr-iep# python3 run_model.py --program_generator models/CLEVR/program_generator_18k.pt --execution_engine models/CLEVR/execution_engine_18k.pt --image img/CLEVR_val_000013.png --question "Does the small sphere have the same color as the cube left of the gray cube?"

Loading program generator from models/CLEVR/program_generator_18k.pt
Loading execution engine from models/CLEVR/execution_engine_18k.pt

Loading CNN for feature extraction
Running the model

Traceback (most recent call last):
File "run_model.py", line 301, in
main(args)
File "run_model.py", line 85, in main
run_single_example(args, model)
File "run_model.py", line 159, in run_single_example
argmax=(args.sample_argmax == 1))
File "/opt/data/penggao/pytorch_project/clevr-iep/iep/models/seq2seq.py", line 170, in reinforce_sample
logprobs, h, c = self.decoder(encoded, cur_input, h0=h, c0=c)
File "/opt/data/penggao/pytorch_project/clevr-iep/iep/models/seq2seq.py", line 92, in decoder
V_in, V_out, D, H, L, N, T_in, T_out = self.get_dims(y=y)
File "/opt/data/penggao/pytorch_project/clevr-iep/iep/models/seq2seq.py", line 57, in get_dims
T_out = y.size(1) if y is not None else None
RuntimeError: invalid argument 2: out of range at /pytorch/torch/lib/THC/generic/THCTensor.c:23

from clevr-iep.

gaopeng-eugene avatar gaopeng-eugene commented on September 26, 2024

change seq2seq model line 173
if argmax:
_, cur_output = probs.max(1)
else:

to
if argmax:
_, cur_output = probs.max(1)
cur_output = cur_output.unsqueeze(0)
else:

from clevr-iep.

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.