问题出现在尝试使用MNIST数据集时的tensorflow和matplotlib包。

huangapple go评论66阅读模式
英文:

Problem with tensorflow and matplotlib packages when attempting MNIST dataset

问题

I get the "no module called tensorflow" and "no module called matplotlib" errors.

英文:

I'm attempting to do the MNIST dataset with tensorflow as a practice exercise and am having some issues with the packages. I'm using Pycharm 2019.3.1.
Here's my code:

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))

I get the "no module called tensorflow" and "no module called matplotlib" errors.

答案1

得分: 1

以上的错误提示表明您的系统中尚未安装tensorflow和matplotlib库。您可以创建一个虚拟环境或conda环境,并激活该环境,在新创建的虚拟环境或conda环境中安装上述库,并运行上述Python程序。

英文:

The errors above indicate that you have not installed tensorflow and matplotlib libraries in your system. You can create a virtual environment or conda environment, and activate the environment, install the above libraries and run the above python program inside the newly created virtual environment or conda environment.

huangapple
  • 本文由 发表于 2020年1月7日 00:26:54
  • 转载请务必保留本文链接:https://go.coder-hub.com/59615600.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定