Thanks for the note on pinning. My FastAI version, nonetheless, is 2.1.4 (the latest according to the Github Changelogs). Should I be pinning the versions of FastCore and Pytorch as well then? And if so, where can I find the versions that are compatible with FastAI.
EDIT: FastAI is v2.1.4 and FastCore is 1.3.1 (the latest for both). Pytorch is not installed apparently, but my previously I did not have any problems without it.
EDIT (2): The error has arisen literally a few hours ago. I developed the model and loaded it with no problem all within the past 24 hours, so it’s not like I have been basing my work on older code necessarily, which is why this is strange and I am not sure how to resolve it.
EDIT (3): My error is as follows:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-5-7726f78efb69> in <module>
----> 1 learn_inf = load_learner(path/'export.pkl')
/opt/conda/envs/fastai/lib/python3.8/site-packages/fastai/learner.py in load_learner(fname, cpu)
551 "Load a `Learner` object in `fname`, optionally putting it on the `cpu`"
552 distrib_barrier()
--> 553 res = torch.load(fname, map_location='cpu' if cpu else None)
554 if hasattr(res, 'to_fp32'): res = res.to_fp32()
555 if cpu: res.dls.cpu()
/opt/conda/envs/fastai/lib/python3.8/site-packages/torch/serialization.py in load(f, map_location, pickle_module, **pickle_load_args)
592 opened_file.seek(orig_position)
593 return torch.jit.load(opened_file)
--> 594 return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
595 return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
596
/opt/conda/envs/fastai/lib/python3.8/site-packages/torch/serialization.py in _load(zip_file, map_location, pickle_module, pickle_file, **pickle_load_args)
851 unpickler = pickle_module.Unpickler(data_file, **pickle_load_args)
852 unpickler.persistent_load = persistent_load
--> 853 result = unpickler.load()
854
855 torch._utils._validate_loaded_sparse_tensors()
AttributeError: Can't get attribute 'CrossEntropyLossFlat' on <module 'fastai.layers' from '/opt/conda/envs/fastai/lib/python3.8/site-packages/fastai/layers.py'>
I have checked my dependencies, restarted my kernels multiple times, tried on other notebooks, all with the same error. I am pretty stumped and unable to find a solution for it online.