How to read a ckpt file with python3, while it is saved using python2？
I try to read a checkpoint file with pyTorch

checkpoint = torch.load(xxx.ckpt)


The file was generated by a program written using python 2.7. I try to read the file using python 3.6 but get the following error

UnicodeDecodeError: 'ascii' codec can't decode byte 0x8c in position 16: ordinal not in range(128)


Is it possible to read the file without downgrade python?

Eventually I solve the issue by

1) create a python2 environment using anaconda

2) read the checkpoint file using pytorch, and then save it using pickle

checkpoint = torch.load("xxx.ckpt")
with open("xxx.pkl", "wb") as outfile:
    pickle.dump(checkpointfile, outfile)


3) back to the python3 environment, read the file using pickle, save the file using pytorch

pkl_file = open("xxx.pkl", "rb")
data = pickle.load(pkl_file, encoding="latin1")
torch.save(data, "xxx.ckpt")

