numpy() is only available when eager execution is enable
用yolov4训练自己的数据集的时候出现这个问题....
版本信息:tensorflow-gpu2.1.0,keras2.3.1
numpy() is only available when eager execution is enable
用yolov4训练自己的数据集的时候出现这个问题....
版本信息:tensorflow-gpu2.1.0,keras2.3.1
对于此问题,从网上查阅看解决的尝试多种多样,主要有,1.将代码中使用np的函数改成用tf中的函数。如bias_inv = np.arctanh(bias),改成bias_inv = tf.math.atanh(bias);2.在导入tf后加上一句tf.compat.v1.enable_eager_execution() 开启eager_execution模式;3.使用import tensorflow.keras.backend as K替代from keras import backend as K。对这些方法你借鉴参考一下。