wuhuikai/TF-A2RL

About the problem of pickle

Closed this issue · 11 comments

Traceback (most recent call last):
File "A2RL.py", line 15, in
var_dict = pickle.load(f)
File "/home/stu_3/anaconda2/lib/python2.7/pickle.py", line 1384, in load
return Unpickler(file).load()
File "/home/stu_3/anaconda2/lib/python2.7/pickle.py", line 864, in load
dispatchkey
KeyError: '<'

I have met this problem when running the sh example.sh file. How to solve this problem? Thank you very much!

The code is only tested with python3, try to run it with python 3.5 or python 3.6

@wuhuikai
I installed python3 with Anaconda (also with python2.7), and utilize the conda create --name python3 python=3.6 activate python3. But the same problem still exists.

(python3) stu_3@rs:~/Documents/task14/DRL/DRL_img/TF-A2RL$ sh example.sh
Traceback (most recent call last):
File "A2RL.py", line 15, in
var_dict = pickle.load(f)
_pickle.UnpicklingError: invalid load key, '<'.

@whuhxb I run the code as your instructions and met no errors. A possible cause is that the vfn_rl.pkl is broken. The md5sum of vfn_rl.pkl is f40cc5de88aaf72ae930ac23ba030a92, what about yours ?

@wuhuikai
I download the vfn_rl.pkl again, the previous problem disappeared. I want to know whether your code only supports the jpg format. Does it support the tiff format images? In addition, how to utilize your code for batch processing because I have a large number of images to be processed.

@whuhxb It support all formats supported by scikit-image.
If you want to batch process images, you can look the example code Here.

@wuhuikai
Another question: Can your code directly be utilized on my own data with your vfn_rl.pkl? Or should I train my own data with your code by obtaining the vfn_rl.pkl?

@whuhxb It should generalize to your data well, but I'm not sure. Currently the training code is not available.

@wuhuikai
Thank you very much. If I have several images in an folder to be cropped, in order to utilize the batch processing, should I just give the --image_path and --save_path without the specific .jpg images?

@whuhxb You shouldn't. You'd better write your own main function to read a batch of images from files, feed them to a2rl as a list and then crop the images and save them.

Since your main issue has been resolved, I decide to close this issue.

@wuhuikai
OK. Thank you very much!