Comments (8)
Could you let us know which version of PyTorch you're running and what version of our code you have?
Note: I updated your comment to use triple-backticks so the line breaks in your code blocks are displayed properly.
from tbd-nets.
thank you for your reply! I use PyTorch v0.3.0 and python3.5, the code is the latest you put on github. and I extract the images and questions feature by using this instructions, I got 2 h5 files about val.
from tbd-nets.
The latest version of master was rewritten to run in PyTorch 0.4, which unfortunately broke compatibility with v0.3 and earlier. If you git checkout tags/torch0.3
then the code should run. There's a note buried in our README but it's a bit hard to find.
Alternatively, upgrading to PyTorch 0.4 has many niceties that are worth the upgrade. The PyTorch API has also stabilized and is not expected to change dramatically.
from tbd-nets.
I upgrade my pytorch to 0.4, and the old problem disappear,but new problem came like that
Generating programs...
/home/dengwei/tbd-nets/utils/generate_programs.py:261: UserWarning: volatile was removed and now has no effect. Use `with torch.no_grad():` instead.
volatile=True)
Traceback (most recent call last):
File "eval.py", line 17, in <module>
dest_dir=Path('data/val'), batch_size=128)
File "/home/dengwei/tbd-nets/utils/generate_programs.py", line 263, in generate_programs
programs_pred = program_generator.reinforce_sample(questions_var)
File "/home/dengwei/tbd-nets/utils/generate_programs.py", line 137, in reinforce_sample
y[:, t][not_done] = cur_output_data[not_done]
RuntimeError: expand(torch.LongTensor{[128, 1]}, size=[128]): the number of sizes provided (1) must be greater or equal to the number of dimensions in the tensor (2)
so, the batchsize is not right?but I change the batchsize the error still exist. could u give me some advice to solve it?
from tbd-nets.
Are you on the latest master? That line that's failing should actually be
y[:, t][not_done] = cur_output_data[not_done][0]
and it looks like your file is missing that [0]
at the end. This should be line 132 of utils/generate_programs.py
from tbd-nets.
@bidongqinxian did this fix the issue?
from tbd-nets.
yes, I downloaded the former master and now I update the latest master.But unfortunately, other error came out as:
Traceback (most recent call last):
File "eval.py", line 72, in <module>
outputs = tbd_net(feats, programs)
File "/home/dengwei/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 491, in __call__
result = self.forward(*input, **kwargs)
File "/home/dengwei/tbd-nets/tbd/module_net.py", line 195, in forward
output = module(feat_input, output)
File "/home/dengwei/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 491, in __call__
result = self.forward(*input, **kwargs)
File "/home/dengwei/tbd-nets/tbd/modules.py", line 92, in forward
attended_feats = torch.mul(feats, attn.repeat(1, self.dim, 1, 1))
RuntimeError: The size of tensor a (128) must match the size of tensor b (16384) at non-singleton dimension 1
did I miss something? thanks for your advice.@davidmascharka
from tbd-nets.
Since that fixes the original issue here I'm going to close this.
Without seeing your eval.py
file I really can't say where the error is coming from. It looks like something is getting reshaped incorrectly or the batch is malformed. Feel free to open another issue and post that code if you're unable to diagnose from there.
from tbd-nets.
Related Issues (14)
- Training the model Step 2
- Properties not specified in modules? HOT 1
- Efficiency question about the model HOT 2
- About converting HDF5 to npy HOT 1
- Version bumps HOT 2
- `imresize` was removed in scipy 1.3 HOT 2
- can not find file scripts/extract_features.py HOT 2
- The environment setting HOT 6
- How to evaluate test results? HOT 4
- tensor matches error HOT 10
- No longer runs on mybinder.org HOT 4
- RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn HOT 3
- What's the use of cat operation in SameModule HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tbd-nets.