Comments (4)
Usually the code won't get NaN, but it's ok to add this line.
from diffuseq.
Hello!I met the same error, and I use your method. But It makes the sum of p is not 1, there is another error, because of np.random.choice . so I change the code to:
p = w / np.sum(w)
if np.sum(np.isnan(p)) > 0:
p[np.isnan(p)] = 0
p = p / np.sum(p)
indices_np = np.random.choice(len(p), size=(batch_size,), p=p)
indices = th.from_numpy(indices_np).long().to(device)
But I got the NAN error again.
This is my train.sh, I just use my dataset and change the dim
Hope you can give me some advice
from diffuseq.
Hello, I also meet Nan error when using my own dataset.
One advice is to set you batch size smaller, I set --bsz 64.(It works for me)
Another advice is to change the code,
if hasNan:
print("has Nan prob p=",p)
size = len(p)
p = np.ones(p.shape) * (1/size)
print("new p =",p)
from diffuseq.
Ok, I'll try your method, thank you!!!!
commented
from diffuseq.
Related Issues (20)
- Padding during training results in a "Killed"
- BERT parameter
- Try to train the model with another dataset, but get so many [UNK] token.
- a few questions about the 'MBR' decoding strategy. HOT 2
- Version of many packages
- Incorrect self-BLEU Computation
- a question about --local_rank
- Could not find a version that satisfies the requirement torch==1.9.0+cu111
- i face some promble Dataset(2) in "text_datasets.py" HOT 1
- If there is any rule to modify the parameters HOT 1
- Machine Translation Task with DiffuSeq HOT 6
- A question about the loss in V2
- Implementation of using soft absorbing state in the forward process in training. HOT 1
- ddim sampling HOT 2
- DDPM HOT 3
- train
- Where is CommonsenseConversation/test.jsonl ? When I run train. sh and then run run_decode_solver. sh or run_decode. sh, I always can't find test.jsonl HOT 2
- 'grad_norm' is NaN HOT 3
- Understanding tT_loss HOT 2
- questions on source data
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 diffuseq.