简体   繁体   English

我该如何解决这个问题? 尝试运行 mnist 代码,但显示此错误

[英]How do i solve this? Trying to run the mnist code but it shows this error

import numpy as np import cv2 np.random.seed(123) import keras导入 numpy 作为 np 导入 cv2 np.random.seed(123) 导入 keras

NameError: name 'numPyPython' is not defined NameError:未定义名称“numPyPython”

please help请帮忙

make sure you have numpy确保你有 numpy

try to install numpy in cmd尝试在 cmd 中安装 numpy

pip install numpy pip 安装 numpy

- -

and try to use " np " only since you declared it as "np" or if you don't want you can simply "import numpy" only并尝试使用“np”,因为您将其声明为“np”,或者如果您不想要,您可以仅“导入 numpy”

Make sure you have installed numpy in your system.确保您已在系统中安装 numpy。 There are many ways to install numpy. numpy有多种安装方式。 you can create a virtual environment and then activate it.After that you can type this "conda install numpy" and numpy will get installed in your environment.您可以创建一个虚拟环境,然后激活它。之后,您可以输入“conda install numpy”,numpy 将安装在您的环境中。 You can also use the command prompt of your system and then type this "pip install numpy".您也可以使用系统的命令提示符,然后键入“pip install numpy”。 Different operating systems follow a different procedures for detail you can go through this site: https://numpy.org/install/不同的操作系统遵循不同的程序详细可以go通过这个网站: https://numpy.org/install/

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我正在尝试运行现有代码,但是当我尝试运行代码时,错误显示“没有名为 fetch 的模块” - I am trying to run and existing code but when I try to run the code the error shows “No module named fetch” 我的MNIST数据集的python代码显示了巨大的错误值,我缺少什么? - My python code for MNIST dataset shows gigantic error values, what I am missing? 尝试运行 mnist.py。 代码运行,但我看到的只是浏览器中的“无法连接”消息 - Trying to run mnist.py. Code runs but all I see is 'Unable to Connect' message in browser 如何解决以下代码中的语法错误? - How do I solve Syntax error in the following code? 如何解决 python 中的此错误(Jupyter 笔记本中的代码) - how do I solve this error in python (code in Jupyter notebook) 尝试读取MNIST数据时为什么会出现EOFError错误? - Why do I get EOFError error when trying to read MNIST data? 我正在尝试使用 solve_ivp 求解一组六个方程。 该代码需要永远运行,我不确定是否有更快的方法来执行此操作 - I am trying to solve a set of six equations using solve_ivp. The code is taking forever to run and I am unsure if there is a quicker way to do this 我正在尝试通过 ssh 从服务器下载目录并出现错误,我该如何解决? - I'm trying to download a directory from the server via ssh and an error comes up, how do I solve it? 试图编写一个计数游戏,这个错误不断发生,我不知道如何解决它(真的是初学者级别) - Trying to code a counting game, this error keeps occuring and I'm not sure how to solve it (really beginner level) 如何解决我的python代码中的以下错误,我正在尝试使用tiknter库构建一个程序 - How to solve the following error in my python code, I'm trying to build a program using tiknter library
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM