Tensorfow2.0不能使用get_session问题

RuntimeError: get_session is not available when using TensorFlow 2.0.

yolov3中源代码有这样:

self.sess = K.get_session()

报错显示tf2.0以上移除了这函数,网上大部分方法都是降低tf版本,解决如下:

将self.sess = K.get_session()改为

self.sess = tf.compat.v1.Session()

猜你喜欢

转载自blog.csdn.net/lingchuxiao/article/details/106825003
今日推荐