Git Product home page Git Product logo

focusseq2seq's People

Contributors

clovaaiadmin avatar j-min avatar seominjoon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

focusseq2seq's Issues

Performing inference

Hello and thank you for the code!

Is there a simple way to perform inference using a trained model?

How do I use --eval_only?

I have run through the code following the instructions and trained a QG model. My best checkpoint was 7.

So this next time round, I just want to load the saved checkpoint and look at the outputs from the val set.

Here are my configs:

!python train.py --task=QG --model=NQG --load_glove=True --feature_rich --data=squad \ --load --load_ckpt=7 --eval_only

I keep on getting this error:

Traceback (most recent call last):
File "train.py", line 136, in
n_iter = len(train_loader)
TypeError: object of type 'NoneType' has no len()

So if I understand it correctly, with eval_only, I should by-pass loading the training and validation sets and just test it.

However, there is no actual code in train.py to look at "eval_only" as far as I can see. It will always assume I am going through the whole training.

Prediction

How to use question generation model to generate questions from the text we have?

CUDNN_STATUS_EXECUTION_FAILED

I amfacing this issue while running the train.py command

I am using CUDA=10.0 and GPU= GeForce GTX 1660 Ti

COMMAND : python train.py --task=QG --model=NQG --load_glove=True --feature_rich --data=squad --rnn=GRU --dec_hidden_size=512 --dropout=0.5 --batch_size=64 --eval_batch_size=64 --use_focus=True --n_mixture=3 --decoding=greedy

#==== Weight Initialization ====#

Total Parameters: 12295050

Loaded word embedding!
Traceback (most recent call last):
File "train.py", line 110, in
model.to(device)
File "/home/xxx/FocusSeq2Seq/focus/lib/python3.6/site-packages/torch/nn/modules/module.py", line 386, in to
return self._apply(convert)
File "/home/xxxx/FocusSeq2Seq/focus/lib/python3.6/site-packages/torch/nn/modules/module.py", line 193, in _apply
module._apply(fn)
File "/home/xxxx/FocusSeq2Seq/focus/lib/python3.6/site-packages/torch/nn/modules/module.py", line 193, in _apply
module._apply(fn)
File "/home/xxxx/FocusSeq2Seq/focus/lib/python3.6/site-packages/torch/nn/modules/module.py", line 193, in _apply
module._apply(fn)
[Previous line repeated 1 more time]
File "/home/xxxx/FocusSeq2Seq/focus/lib/python3.6/site-packages/torch/nn/modules/rnn.py", line 127, in _apply
self.flatten_parameters()
File "/home/xxx/FocusSeq2Seq/focus/lib/python3.6/site-packages/torch/nn/modules/rnn.py", line 123, in flatten_parameters
self.batch_first, bool(self.bidirectional))
RuntimeError: cuDNN error: CUDNN_STATUS_EXECUTION_FAILED

hidden size doesn't match

Hi, thanks for open-source the code!

However, when I change the 'dec_hidden_size' to 256, an error occurs:

Traceback (most recent call last):
  File "train.py", line 351, in <module>
    train=True)
  File "/search/data3/xxx/py3_pytorch_venv/lib/python3.7/site-packages/torch/nn/modules/module.py", line 547, in __call__
    result = self.forward(*input, **kwargs)
  File "/search/data3/xxx/FocusSeq2Seq/models.py", line 272, in forward
    diversity_lambda=diversity_lambda)
  File "/search/data3/xxx/py3_pytorch_venv/lib/python3.7/site-packages/torch/nn/modules/module.py", line 547, in __call__
    result = self.forward(*input, **kwargs)
  File "/search/data3/xxx/FocusSeq2Seq/layers/decoder.py", line 296, in forward
    s = self.rnncell(dec_input, s)
  File "/search/data3/xxx/py3_pytorch_venv/lib/python3.7/site-packages/torch/nn/modules/module.py", line 547, in __call__
    result = self.forward(*input, **kwargs)
  File "/search/data3/xxx/py3_pytorch_venv/lib/python3.7/site-packages/torch/nn/modules/rnn.py", line 1015, in forward
    self.check_forward_input(input)
  File "/search/data3/xxx/py3_pytorch_venv/lib/python3.7/site-packages/torch/nn/modules/rnn.py", line 761, in check_forward_input
    input.size(1), self.input_size))
RuntimeError: input has inconsistent input_size: got 812, expected 556

I guess it is because the 'context' doesn't 'bridge' to the right size.
How should I fix it? Thank you so much.

'chmod' is not recognized as an internal or external command !!!

On executing the command: python train.py --task=QG --model=NQG --load_glove=True --feature_rich --data=squad --rnn=GRU --dec_hidden_size=512 --dropout=0.5 --batch_size=64 --eval_batch_size=64 --use_focus=True --n_mixture=3 --decoding=greedy

I get following error:

'chmod' is not recognized as an internal or external command,
operable program or batch file.
Traceback (most recent call last):
File "train.py", line 22, in
from utils.tensor_utils import repeat
File "C:\Users\Emergent Tech HP\my_projects\NQG_python3.6\FocusSeq2Seq\utils_init_.py", line 1, in
from .rouge import *
File "C:\Users\Emergent Tech HP\my_projects\NQG_python3.6\FocusSeq2Seq\utils\rouge_init_.py", line 1, in
from .perl_rouge import *
File "C:\Users\Emergent Tech HP\my_projects\NQG_python3.6\FocusSeq2Seq\utils\rouge\perl_rouge.py", line 15, in
_ = Rouge155(rouge_dir, log_level=0)
TypeError: init() got an unexpected keyword argument 'log_level'

Am I getting this error because I am using windows machine ??

RuntimeError: expected device cuda:0 and dtype Byte but got device cuda:0 and dtype Bool

On executing train.py, I am getting the following error:

Epoch [0/20] | Iteration [1345/1346] | NLL Loss : 3.776 | NLL Loss (running avg) : 3.881 | Focus Loss : 0.176 | Time taken: : 11.62
Epoch Done! It took 338.58s
Evaluation start!
/pytorch/aten/src/ATen/native/cuda/LegacyDefinitions.cpp:14: UserWarning: masked_fill_ received a mask with dtype torch.uint8, this behavior is now deprecated,please use a mask with dtype torch.bool instead.
/pytorch/aten/src/ATen/native/cuda/LegacyDefinitions.cpp:14: UserWarning: masked_fill_ received a mask with dtype torch.uint8, this behavior is now deprecated,please use a mask with dtype torch.bool instead.
/pytorch/aten/src/ATen/native/cuda/LegacyDefinitions.cpp:14: UserWarning: masked_fill_ received a mask with dtype torch.uint8, this behavior is now deprecated,please use a mask with dtype torch.bool instead.
/pytorch/aten/src/ATen/native/cuda/LegacyDefinitions.cpp:14: UserWarning: masked_fill_ received a mask with dtype torch.uint8, this behavior is now deprecated,please use a mask with dtype torch.bool instead.
/pytorch/aten/src/ATen/native/cuda/LegacyDefinitions.cpp:14: UserWarning: masked_fill_ received a mask with dtype torch.uint8, this behavior is now deprecated,please use a mask with dtype torch.bool instead.
/pytorch/aten/src/ATen/native/cuda/LegacyDefinitions.cpp:14: UserWarning: masked_fill_ received a mask with dtype torch.uint8, this behavior is now deprecated,please use a mask with dtype torch.bool instead.
/pytorch/aten/src/ATen/native/cuda/LegacyDefinitions.cpp:14: UserWarning: masked_fill_ received a mask with dtype torch.uint8, this behavior is now deprecated,please use a mask with dtype torch.bool instead.
Traceback (most recent call last):
File "train.py", line 440, in
val_loader, model, epoch, config)
File "/home/riturajk/my_notebook_env/Q_Gen_exp_1/FocusSeq2Seq/evaluate.py", line 146, in evaluate
diversity_lambda=config.diversity_lambda)
File "/home/riturajk/my_notebook_env/lib/python3.6/site-packages/torch/nn/modules/module.py", line 547, in call
result = self.forward(*input, **kwargs)
File "/home/riturajk/my_notebook_env/Q_Gen_exp_1/FocusSeq2Seq/models.py", line 272, in forward
diversity_lambda=diversity_lambda)
File "/home/riturajk/my_notebook_env/lib/python3.6/site-packages/torch/nn/modules/module.py", line 547, in call
result = self.forward(*input, **kwargs)
File "/home/riturajk/my_notebook_env/Q_Gen_exp_1/FocusSeq2Seq/layers/decoder.py", line 472, in forward
finished += generated_eos
RuntimeError: expected device cuda:0 and dtype Byte but got device cuda:0 and dtype Bool

AssertionError in Ubuntu 14.04.5

Hi
I used conda to install all lib mention in requirement.txt
however, when I try
python train.py --task=QG --model=NQG --load_glove=True --feature_rich --data=squad --rnn=GRU --dec_hidden_size=512 --dropout=0.5 --batch_size=64 --eval_batch_size=64 --use_focus=True --n_mixture=3 --decoding=greedy

I got this result:
Traceback (most recent call last): File "train.py", line 22, in <module> from utils.tensor_utils import repeat File "/home/alznn/focusseq2seq/FocusSeq2Seq/utils/__init__.py", line 1, in <module> from .rouge import * File "/home/alznn/focusseq2seq/FocusSeq2Seq/utils/rouge/__init__.py", line 1, in <module> from .perl_rouge import * File "/home/alznn/focusseq2seq/FocusSeq2Seq/utils/rouge/perl_rouge.py", line 13, in <module> assert os.path.exists(rouge_path) AssertionError
Do anyone have any idea about this error?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.