英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论