TypeError: scatter_add() missing 1 required positional arguments: "src"
See original GitHub issueHi Chen,
I have tried to follow your instructions exactly, but the following happens when I run the pretrained model:
loading checkpoint ckpt-0-0...
loading checkpoint ckpt-42.508549-0...
/home/arnav-gulati/.local/lib/python3.6/site-packages/torch/nn/functional.py:1374: UserWarning: nn.functional.tanh is deprecated. Use torch.tanh instead.
warnings.warn("nn.functional.tanh is deprecated. Use torch.tanh instead.")
Traceback (most recent call last):
File "decode_full_model.py", line 169, in <module>
args.max_dec_word, args.cuda)
File "decode_full_model.py", line 87, in decode
all_beams = abstractor(ext_arts, beam_size, diverse)
File "/home/arnav-gulati/Documents/other_models/fast_abs_rl-master/decoding.py", line 116, in __call__
all_beams = self._net.batched_beamsearch(*dec_args)
File "/home/arnav-gulati/Documents/other_models/fast_abs_rl-master/model/copy_summ.py", line 125, in batched_beamsearch
token, states, attention, beam_size)
File "/home/arnav-gulati/Documents/other_models/fast_abs_rl-master/model/copy_summ.py", line 245, in topk_step
source=score.contiguous().view(beam*batch, -1) * copy_prob
TypeError: scatter_add() missing 1 required positional arguments: "src"
The command I used was:
python3 decode_full_model.py --path=/home/arnav-gulati/Documents/other_models/fast_abs_rl-master --model_dir=/home/arnav-gulati/Documents/other_models/fast_abs_rl-master/pretrained/acl --beam=5 --test
and I followed your instructions on exporting the data path with:
export DATA=/home/arnav-gulati/Documents/cnn-dailymail-master/finished_files/
I am not sure what causes the following line:
TypeError: scatter_add() missing 1 required positional arguments: "src"
Do you have any advice on what I should do? I believe I have installed all the dependencies, but just in case you want to see them, here they are:
boto 2.49.0 boto3 1.9.171 botocore 1.12.171 bz2file 0.98 certifi 2019.6.16 chardet 3.0.4 cytoolz 0.9.0.1 docutils 0.14 futures 3.2.0 gensim 3.7.3 idna 2.8 jmespath 0.9.4 numpy 1.16.4 pip 19.1.1 protobuf 3.8.0 pyrouge 0.1.3 python-dateutil 2.8.0 requests 2.22.0 s3transfer 0.2.1 scipy 1.2.2 setuptools 41.0.1 six 1.12.0 smart-open 1.8.4 tensorboardX 1.7 toolz 0.9.0 torch 0.4.0 urllib3 1.25.3 wheel 0.33.4
Any help would be appreciated!
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
Hi @A-Gulati,
I am using this model in my own repository. I upgraded to PyTorch 1.1, and I remember needing to change the scatter_add code to get it working.
I changed it from:
to
This made it work.
Hi, I am pretty sure the API of
scatter_add
issource
notsrc
as seen in your error message. Please see hereI would suggest you to try to completely remove pytorch and reinstall the 0.4.0 version. I recommend using anaconda python and use conda to install pytorch. Hope this will resolve the issue.