mdietrichstein / tensorflow-open_nsfw

Tensorflow Implementation of Yahoo's Open NSFW Model
Other
430 stars 136 forks source link

fixes failure when numpy version is 1.16.2. #20

Open mogoweb opened 5 years ago

mogoweb commented 5 years ago

when numpy version is 1.16.2, it will raise the following error: Traceback (most recent call last): File "classify_nsfw.py", line 69, in <module> main(sys.argv) File "classify_nsfw.py", line 44, in main model.build(weights_path=args.model_weights, input_type=input_type) File "/home/alex/work/ai/tensorflow/projects/tensorflow-open_nsfw/model.py", line 30, in build self.weights = np.load(weights_path, encoding="latin1").item() File "/home/alex/anaconda3/envs/tensorflow-gpu/lib/python3.6/site-packages/numpy/lib/npyio.py", line 447, in load pickle_kwargs=pickle_kwargs) File "/home/alex/anaconda3/envs/tensorflow-gpu/lib/python3.6/site-packages/numpy/lib/format.py", line 692, in read_array raise ValueError("Object arrays cannot be loaded when " ValueError: Object arrays cannot be loaded when allow_pickle=False