Closed alice-cool closed 3 years ago
what is the version of python? pytorch?
from allennlp.training.trainer import move_optimizer_to_cuda
ImportError: cannot import name 'move_optimizer_to_cuda'
what is the version of allennlp。 I install the version 1.2.0,but it doesn't know the allennlp.training.trainer import move_optimizer_to_cuda. ?
from allennlp.training import util as training_util Ok I found the new document training_util and We can write " from allennlp.training import util as training_util and in the code we write training_util.move_optimizer_to_cuda
from allennlp.data.batch import Batch
Thanks for your open code
from allennlp.training.trainer import move_optimizer_to_cuda
ImportError: cannot import name 'move_optimizer_to_cuda'
Good job! Thank you very much for the experence, I replace "from allennlp.training.trainer import move_optimizer_to_cuda" with "from allennlp.training.util import move_optimizer_to_cuda" and then it run.
Thanks for your open code