I am facing a very weird issue when loading a saved model using pickle.load. I had trained a pyG GCN model and saved it like this:
import pickle path = '/content/drive/MyDrive/' file = open(path + 'bamodel', 'wb') pickle.dump(model, file) file.close()
I am loading it like this:
import pickle # open a file, where you stored the pickled data path = '/content/drive/MyDrive/' file = open(path+ 'bamodel', 'rb') model = pickle.load(file)
But, when I try to load the model, I receive the error:
AttributeError: ‘Linear’ object has no attribute ‘_lazy_load_hook’
I have started facing the issue today, while I was not facing the issue earlier
Neither did I change the ‘bamodel’ file, nor anything else, so I am pretty surprised at why is this error coming up. I searched the internet but no on else seems to have faced this issue before. Any help is greatly appreciated!