2

When trying to run a python notebook on google colab, mentioned in https://medium.com/@markn_67491/run-allennlp-models-on-free-gpus-using-googles-colab-notebooks-4db9359970c1 available from: https://drive.google.com/file/d/1JH6dz8GJbwh9GhPoZQKwR-EipeR5JBrV/view

after installing pytorch and AllenNlp I run

from allennlp.models.archival import load_archive
from allennlp.service.predictors import Predictor
import pprint

pretty_print = pprint.PrettyPrinter(indent=4)

which crashes on the second line due to ...

AttributeError: module 'torch.optim.lr_scheduler' has no attribute 'CosineAnnealingLR'

note: https://github.com/pytorch/pytorch/issues/3214 suggest upgrading to version 3.0 but even with pip3 install http://download.pytorch.org/whl/cu80/torch-0.3.1-cp36-cp36m-linux_x86_64.whl i.e. version 3.1 the issues persists. Any suggestions

MBT
  • 21,733
  • 19
  • 84
  • 102
Oren Bochman
  • 1,173
  • 3
  • 16
  • 37
  • Somewhat related, I just got AttributeError: 'MultiplicativeLR' object has no attribute 'zero_grad' when attempting to zero_grad a scheduler with an Adam passed optimizer. Maybe I need to still zero_grad the optimizer and then call the scheduler... – Mauricio Maroto Jan 03 '21 at 19:01

0 Answers0