Comments (3)
Hi,
From the error you have, it seems you are using pytorch 0.4. Our code has been developed using pytorch 0.3. Maybe that is the problem. Can you try to downgrade your pytorch version (https://pytorch.org/previous-versions/)?
Soon we will update our code to pytorch 0.4 :)
from mem2seq.
yeah...it's true. it works fine that add .item() after topvi.squeeze()[i].
Thank you again.
from mem2seq.
Great,
pls be also careful to add .item() everywhere. In particular in toppi, else it will compare tensor to an integer, and it will always return false (i.e. always getting from vocab).
So use something like:
int(toppi.squeeze()[i].item())
Best
Andrea
from mem2seq.
Related Issues (20)
- Why add $$$$ after each English sentence? HOT 1
- Code fails on evaluation for kvr HOT 7
- Can I run this code on pytorch 0.4 now? HOT 2
- What operating system is installed on your computer? HOT 1
- when i run PTRUNK, i got an error HOT 3
- why use the nn.Embedding rather than something pre-trained HOT 1
- Could you tell what is the difference between with or without useKB? HOT 4
- ptr_UNK network failed. HOT 1
- i'm confusing about p_ptr variable in ptrMemDecoder function in decoder? HOT 1
- Data loading reverse KB entry HOT 1
- ERROR When running HOT 8
- Pre-processing questions HOT 1
- About import HOT 3
- about version of environment HOT 1
- Question about the predicted reply from trained model
- The meaning of comments in the code.
- Entity F1 without KB HOT 1
- question about function get_state?
- Project dependencies may have API risk issues
- acc_avg and wer_avg
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 mem2seq.