autonomio / talos

Hyperparameter Experiments with TensorFlow and Keras
https://autonom.io
MIT License
1.62k stars 269 forks source link

Restore() Object arrays cannot be loaded when allow_pickle=False #351

Closed anilsemizoglu closed 5 years ago

anilsemizoglu commented 5 years ago

I got the following error when I called a saved scan zip file. scan_object=ta.Restore('talos_scans/all_widths_resample_600.zip') I was able to load the scan object by editing line 28 in talos/commands/restore.py to include allow_pickle=True self.params = load(self.file_prefix + '_params.npy',allow_pickle=True).item() Does anyone know why I'm getting this error? Do I have a configuration problem? All other talos functions are working as expected.

numpy version: 1.16.4 keras version: 2.24 talos version: 0.4.9

/anaconda3/envs/neuralnet/lib/python3.7/site-packages/talos/commands/restore.py in __init__(self, path_to_zip)
     26 
     27         # add params dictionary
---> 28         self.params = load(self.file_prefix + '_params.npy').item()
     29 
     30         # add experiment details

/anaconda3/envs/neuralnet/lib/python3.7/site-packages/numpy/lib/npyio.py in load(file, mmap_mode, allow_pickle, fix_imports, encoding)
    445             else:
    446                 return format.read_array(fid, allow_pickle=allow_pickle,
--> 447                                          pickle_kwargs=pickle_kwargs)
    448         else:
    449             # Try a pickle

/anaconda3/envs/neuralnet/lib/python3.7/site-packages/numpy/lib/format.py in read_array(fp, allow_pickle, pickle_kwargs)
    694         # The array contained Python objects. We need to unpickle the data.
    695         if not allow_pickle:
--> 696             raise ValueError("Object arrays cannot be loaded when "
    697                              "allow_pickle=False")
    698         if pickle_kwargs is None:

ValueError: Object arrays cannot be loaded when allow_pickle=False
mikkokotila commented 5 years ago

Thanks, I'm seeing this also in the automated tests. Will most likely get to work on it today.

mikkokotila commented 5 years ago

This is now fixed in daily-dev. Closing here.