I am getting the above mentioned error while loading a pickle file. Please let me know how to handle this.
The code used is
learn_cls = load_learner(fname=path/‘new_72_seq_length_alldesc_with_spaces_87.pkl’)
and error stack trace is
AttributeError Traceback (most recent call last)
in ()
----> 1 learn_cls = load_learner(fname=path/‘new_72_seq_length_alldesc_with_spaces_87.pkl’)/usr/local/lib/python3.6/dist-packages/fastai/learner.py in load_learner(fname, cpu)
547 "Load aLearner
object infname
, optionally putting it on thecpu
"
548 distrib_barrier()
–> 549 res = torch.load(fname, map_location=‘cpu’ if cpu else None)
550 if hasattr(res, ‘to_fp32’): res = res.to_fp32()
551 if cpu: res.dls.cpu()/usr/local/lib/python3.6/dist-packages/torch/serialization.py in load(f, map_location, pickle_module, **pickle_load_args)
582 opened_file.seek(orig_position)
583 return torch.jit.load(opened_file)
–> 584 return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
585 return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
586/usr/local/lib/python3.6/dist-packages/torch/serialization.py in _load(zip_file, map_location, pickle_module, **pickle_load_args)
840 unpickler = pickle_module.Unpickler(data_file, **pickle_load_args)
841 unpickler.persistent_load = persistent_load
–> 842 result = unpickler.load()
843
844 return resultAttributeError: type object ‘EnglishDefaults’ has no attribute ‘is_base_form’
This pickle file loading works on source machine(on which it is generated), but doesn’t get loaded on google colab
Here are specs of machine involved
Source Machine:
fastai version: ‘2.0.16’
pytorch version: ‘1.6.0’
Cuda version: V10.0.130
Colab specs: (loading the pickle file)
fastai version: ‘2.0.16’
pytorch version: 1.6.0+cu101
Cuda version: V10.1.243
Is version an issue? Or anything else? Please guide me on this.
Update: Later today I upgraded my GPU to exact same version of CUDA that is present on colab. Still have the error.
Does the uploading of pkl file to google drive add any additional headers on top of the file ? I am running out of debug options here.
Regards,
Chaitanya Kanth.