【发布时间】:2020-04-24 04:52:48
【问题描述】:
我正在尝试使用 tensorflow 做 MNIST 数据集作为练习,但我遇到了一些包问题。我正在使用 Pycharm 2019.3.1。 这是我的代码:
import tensorflow as tf
import matplotlib.pyplot as plt
(x_train, y_train), (x_test, y_test) = tf.keras.datasets.mnist.load_data()
image_index = 7777
print(y_train(image_index))
plt.inshow(x_train(image_index))
我收到“没有名为 tensorflow 的模块”和“没有名为 matplotlib 的模块”错误。
【问题讨论】:
-
错误提示你运行代码的环境中没有安装tensorflow和matplotlib。
-
请检查这些包是否安装在
File - Settings - Project - Project Interpreter指定的Python解释器上
标签: python tensorflow matplotlib pycharm