allanzelener / YAD2K

YAD2K: Yet Another Darknet 2 Keras
Other
2.71k stars 879 forks source link

AttributeError: Module 'tensorflow' has no attribute 'space_to_depth" #184

Open nonlin opened 4 years ago

nonlin commented 4 years ago

for keras_yolo.py line 32 ini space_to_depth_x2

After running python yad2k.py yolo.cfg yolo.weights model_data/yolo.h5

What is the solution to this?

hcpv commented 4 years ago

It is due to TensorFlow version. You are probably using TensorFlow 2. Solution: remove TensorFlow 2 and install TensorFlow 1 or create a new virtual environment and install TensorFlow 1 and other packages

Mr-Zhu-pg commented 4 years ago

hello, we can't remove it because keras'version we must use Tensorflow>2.2

HugoAhoy commented 3 years ago

use tf.compat.v1.space_to_depth() instead.

luiyiko commented 3 years ago

@HugoAhoy thanks!