Comments (4)
I solved this problem by using --batch_size 300
from arae.
Hello! So I've also run into the same issue and it seems to depend on the version of PyTorch that you're using. So the code at line 202 in models.py hidden = torch.div(hidden, norms.expand_as(hidden))
worked in the last major release version of PyTorch. For the newest release of PyTorch I've had to change it to hidden = torch.div(hidden, norms.unsqueeze(1).expand_as(hidden))
.
Basically this section of the code finds the L2 norm for each of the hidden vectors / codes in the batch, and then divides the hidden vectors by the L2 norm to normalize them into unit vectors. The problem is just that of PyTorch syntax in changing the dimension of the norm to prepare it for the division.
Let me know if you have any more issues related to this.
from arae.
Thanks, this indeed solved the problem.
For reference, in v0.1.12 torch.norm
always keep dims:
The output Tensor is of the same size as input except in the dimension dim where it is of size 1.
http://pytorch.org/docs/0.1.12/torch.html?highlight=norm#torch.norm
But in v0.2.0, the behavior was changed:
If keepdim is true, the output Tensor is of the same size as input except in the dimension dim where it is of size 1. Otherwise, dim is squeezed.
http://pytorch.org/docs/0.2.0/torch.html?highlight=norm#torch.norm
from arae.
#9 (comment) I think this should be uncommented by default now.. it's been almost a year
from arae.
Related Issues (20)
- how to do supervised learning?
- Pretrained model generating empty sentences
- train.py parses 'bool' arguments incorrectly
- errG_real is not backpropagated in the training of generator
- Bad result HOT 1
- Error when running yelp/train.py HOT 9
- Preprocessing for the OneBillion dataset HOT 4
- TypeError: normal() received an invalid combination of arguments - got (means=Tensor, std=float, ), HOT 1
- Loading model with low accuracy HOT 3
- How to use "offset vector transformations" to change text like in the paper?
- Are there something wrong with the gan_d_loss?
- How to generate sentences corresponding to a given label?
- [snli] pretrained weight works while training from scratch results in very bad result.
- vector alternation question
- IndexError for last batch of last epoch HOT 2
- walk.py missing? HOT 2
- Autoencoder evaluation seems to be incorrect
- Can this work with real-valued time series data?
- Error in Pretrained Version HOT 2
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 arae.