首页 > 解决方案 > 模块 tensorflow.tools.api.generator.api.compat 没有属性 v1

问题描述

我在 Ubuntu 上使用 Python 3 和 tensorflow 1.8.0

ipython notebook中,我跑了:

%load_ext autoreload
%autoreload 2
%matplotlib inline
import tensorflow as tf
from keras.layers import Input
tf.compat.v1.image.resize_bilinear()

但我明白了attributeerror: module tensorflow.tools.api.generator.api.compat has no attribute v1

我怎样才能解决这个问题?

标签: pythontensorflow

解决方案


更新 TensorFlow 解决了这个问题。

例如运行pip install --upgrade --ignore-installed tensorflow


推荐阅读