keras使用错误

TensorFlow与Keras兼容性问题:导入错误处理技巧 尽管TensorFlow已经正式收购了Keras并将其整合为tf.keras,但在实际使用过程中,用户仍然可能会遇到TensorFlow与独立版本Keras之间的兼容性问题。为了避免这些问题,建议用户尽量使用TensorFlow 2.x及其内置的tf.keras API。如果你确实需要使用独立版本的Keras,那么请确保版本匹配、解决依赖冲突、使用正确的导入方式,并随时查阅官方文档和社区帮助。通过这些技巧,你可以更有效地处理TensorFlow与Keras之间的兼容性问题。 阅读详情

1:load权重文件(.h5)时,报错"AttributeError: ‘str’ object has no attribute ‘decode’"
在这里插入图片描述
解决方法:
pip install ‘h5py<3.0.0’ -i https://pypi.tuna.tsinghua.edu.cn/simple

2:Inconsistent use of tabs and spaces in indentation
解决方法:检查缩进

3:SyntaxError: invalid character in identifier
解决方法:大概率是符号用成中文

4:IndexError: index 12 is out of bounds for axis 1 with size 12
解决方法:超过axis=1的最大容量,12容量的最大是11

5:AttributeError: ‘Tensor’ object has no attribute ‘_keras_history’
解决方法:
错误原因是keras的数据类型和tensorflow的数据类型不同,两者不能够混用
在定义层的时候
X = X_shortcut + X;
应该是X = Add()([X_shortcut,X])
链接: link.
6:TypeError: Input ‘b’ of ‘MatMul’ Op has type float32 that does not match type float64 of argument 'a
解决方法:tf.cast(x,tf.float32)

7.tf.reduce_sum()
用于计算张量tensor沿着某一维度的和,可以在求和后降维。

8(reshape(-1, m)即列数固定,行数需要计算)

9 keras.backend.clip(x, min_value, max_value)
逐元素clip(将超出指定范围的数强制变为边界值)

10 keras.backend.epsilon
用法:返回数值表达式中使用的模糊因子的值。
返回:一个浮点数。
keras.backend.epsilon()
1e-07

11 在使用x.get_shape().as_list()的前提:x必须为tensor类型
x.get_shape()返回的是一个<‘TensorShape’>的元组类型,as_list()将结果转化为list类型

12 tpye(变量) 查看变量类型

13 linux中查看python的安装路径
方法1:whereis python
查看所有python的路径,不止一个
方法2:which python
查看当前使用的python路径

14 tf.einsum
einsum( equation, *inputs)
Matrix multiplication

einsum(‘ij,jk->ik’, m0, m1) # output[i,k] = sum_j m0[i,j] * m1[j, k]

Dot product

einsum(‘i,i->’, u, v) # output = sum_i u[i]*v[i]

Outer product

einsum(‘i,j->ij’, u, v) # output[i,j] = u[i]*v[j]

Transpose

einsum(‘ij->ji’, m) # output[j,i] = m[i,j]

Batch matrix multiplication

einsum(‘aij,ajk->aik’, s, t) # out[a,i,k] = sum_j s[a,i,j] * t[a, j, k]

15 ubuntu 输出重定向到文件
有时候希望想将在终端输出的信息保存到文件,直接在命令后面加上> filename即可
有时候希望同时输出到文件和终端窗口,直接在命令后加上| tee filename即可
举例:
echo 3 > 1.txt
echo 3 | tee 1.txt

16:AttributeError: ‘NoneType‘ object has no attribute ‘_inbound_nodes‘
解决:定义keras中model的layer层,如果用到tf或者keras没有自带的层,需要用lamda层封装
up8 = Lambda(cbam_module)(up8)

17:opencv中imshow内部的参数类型可以分为两种。(1)当输入矩阵是uint8类型的时候,此时imshow显示图像的时候,会认为输入矩阵的范围在0-255之间。(2)如果imshow的参数是double类型的时候,那么imshow会认为输入矩阵的范围在0-1。
解决方法:a=a.astype(np.int8)

Flask与keras结合的几个常见错误 1. ValueError: Tensor Tensor(“dense_1/Sigmoid:0”, shape=(?, 1), dtype=float32) is not an element of this graph. 在Flask中使用tensorflow的model,一在界面中调用 model.predict() 就报下面这个错误,不过在单独的 .py 文件中使用却不报错。 ValueError: Tensor Tensor("dense_1/Sigmoid:0", shape=(?, 1), dt 阅读详情

相关推荐

@菜鸟初学keras错误一 20190620

@菜鸟初学keras错误一 20190620 记录一下今天的错误 初次使用keras,不知道model.compile,不晓得model.fit,不懂的如何保存checkpoint等模型。 经过一番挣扎后发现,model相关的保存可以通过Modelcheckpoint()来保存 Modelcheckpoint介绍 原版可以看https://www.tensorflow.org/api_docs/p...

u010158775的专栏 1447

2023-08-05 YOLOair代码学习-val.py

1、报错:index 12 is out of bounds for axis 0 with size 4。(4)报错: 'Tensor' object has no attribute 'astype'将train.py训练出来的ruus中的权重文件的绝对路径放入上方的参数设置之中即可。解决方案:val.py中的权重文件未更改!(1)检查是否正确设置yaml文件,并设置好yaml文件的路径。(2)axis=0代表行,axis=1代表列。2、以下是探索的无用方法,权当记录。错误原因:索引超出了列表的长度。

weixin_48447951的博客 316

keras/tensorflow 使用flask部署服务的常见错误及部署多个模型

本文主要列举了在用keras/tensorflow训练好模型后,使用flask部署服务时的两个常见错误及一次性解决办法。 类型1、ValueError: Tensor Tensor(“dense_1/Softmax:0”, shape=(?, 5), dtype=float32) is not an element of this graph. 这个错误主要是报模型最后一层出现类似的错误,比如这里的最后一层是softmax,不同的模型最后一层可能不一样,但错误类型一致。 类型2、W tensorflo

qq_42189083的博客 2415

Python报错:IndexError: index 0 is out of bounds for axis 0 with size 0

Python报错:IndexError: index 0 is out of bounds for axis 0 with size 0

sweet_tea_的博客 2万+

保姆级教程:在RK3588 Android12设备树(DTS)中配置MIPI 8 Lane双通道与DSC显示

本文详细介绍了在RK3588 Android12平台上配置MIPI 8 Lane双通道与DSC显示的实战指南。通过设备树(DTS)参数详解、DSC参数计算与PPS配置、双通道同步机制实现等内容,帮助开发者高效完成高分辨率屏幕驱动配置,解决嵌入式显示系统开发中的常见挑战。

weixin_30905133的博客 399

WRF和WPS安装和编译时遇到的问题

检查是否自己netcdf和Fortran编译器一致。解决办法:修改configure.wps里的路径。如果没问题且wrf已成功编译,考虑重新。path修改为jasper在的路径。

m0_54898744的博客 1837

python索引超出范围怎么解决_索引超出范围(Python)

I have some data that I would like to aggregate, but I'm getting the index out of bounds error, and I can't seem to figure out why. Here's my code:if period == "hour":n=3tvec_a=np.zeros([24,6])tvec_a[...

weixin_39927799的博客 2941

PCB过孔电流承载解析:完整指南与数据参考

深入解析PCB过孔的电流承载能力,结合实际应用场景提供可靠设计参考。涵盖影响载流的关键因素,并整理实用的pcb过孔与电流对照一览表,帮助工程师优化布局与布线。

weixin_35677363的博客 632

【无标题】IndexError: index 1 is out of bounds for dimension 0 with size 1

我的错误原因在于,控制数组某一维度的变量我设置为了h,但是在接下来的代码中又不小心使用了h表示别的变量,导致h越界了.index1和index13指的是,你这个数组的某一维度在变为1的时候和13的时候发生了越界.可以通过debug检查数组的变化.

c_cjiajia_的博客 4470

Android 集成Chrome 浏览器内核 Crosswalk

Crosswalk 内核的兴起与消亡 Android 4.4 版本之前,使用的是基于 androidWebKit 的 WebView 但实际上,由于 Android 的碎片化问题(大量存在不同的 Android 系统版本,并且各个厂商对内置应用进行定制化,有可能用的不是最新的浏览器内核)。这就导致 WebView 在真实环境中对 API 的支持根本无迹可寻,越发混乱。 随着混合开发的兴起,前端对 ...

司马懿的西山居 2万+

从AI画稿到3D虚拟时装:Illustrator与Substance 3D的服装设计工作流

本文旨在解决传统服装与纺织品设计师在产品开发流程中,面临的“2D印花图案无法直观预见3D上身效果”、“物理打样成本高昂且周期漫长”的核心痛点。我们将介绍一套纯数字化的3D可视化工作流,核心是利用 Adobe Illustrator 进行矢量印花图案创作,通过 Adobe Substance 3D Sampler 将其转化为逼真的PBR(基于物理渲染)布料材质,并最终在 Adobe Substance 3D Stager 中,将该材质应用于3D服装模型,渲染出照片级的虚拟样衣。本指南将帮助设计师以极低的成本和

Kingsdesigner的博客 1398

keras2onnx遇到的错误

1、安装pip install keras2onnx 首先要注意,python文件千万别命名为keras2onnx.py 执行python k2o.py ,然后遇到下面错误 Using TensorFlow backend. Traceback (most recent call last): File “k2o.py”, line 2, in import keras2onnx File “/...

qq_33206394的博客 3735

海洋捕食者算法(MPA)详解:从海洋生态智慧到高性能优化

摘要: 海洋捕食者算法(MPA)是一种基于海洋生态觅食行为的元启发式优化算法,模拟捕食者(如鲨鱼)的布朗运动和莱维飞行策略进行全局与局部搜索。算法分为三阶段:高速比阶段(全局探索)、单位速度比阶段(平衡搜索)和低速比阶段(局部开发),通过精英矩阵和FADs效应(概率扰动)避免早熟收敛。MPA具有参数少、收敛快、寻优能力强等特点,适用于复杂优化问题,其数学模型将生物行为转化为随机游走与自适应策略,并通过收敛因子动态调整探索-开发平衡。实验表明,MPA在多个基准问题上表现优异。

qq_42212808的博客 274

处理Keras中的`Unknown layer`错误

大家好,我是默语,擅长全栈开发、运维和人工智能技术。在本篇博客中,我们将探讨如何处理Keras中的错误。这个错误通常出现在模型保存和加载过程中,了解并解决它对保持模型的可用性非常重要。关键词:Keras、Unknown layer、模型保存、模型加载、错误解决。原因:模型中包含自定义层,但在加载时未正确注册这些层。解决方案注册自定义层:在加载模型时,确保自定义层已被注册。# 示例代码# 注册自定义层原因:自定义对象未在加载模型时的作用域内。解决方案:使用确保自定义对象在作用域内。# 示例代码。

沉淀所学,分享所思,让热爱与成长同行。商务记录AI实战经验,助力开发者快速成长。 热爱AI,希望做出有影响力的技术成果。 技术点亮生活,分享连接价值与机会。 专注AI落地实战,陪你走好技术每一步。 5万+

PCL Fast Global Registration 快速全局配准(源码版)

Fast Global Registration(FGR)是一种经典的点云粗配准算法,已集成到Open3D和CloudCompare等软件中。本文介绍了该算法的源码实现及优化方法,包括如何通过修改源码直接读取点云进行配准,而不依赖文件中读取特征描述子。文章还提供了关键参数设置(如最大迭代次数、匹配距离等)。算法实现简单高效,未来计划发布基于纯PCL的版本。源码和论文链接已附上,供开发者参考。

点云侠的博客 383

R数据分析:广义估计方程式GEE的做法和解释

好久没有更新文章了,因为同学们咨询的问题有点多,另一个原因就是自己实在太懒。。。。 今天继续给大家写广义估计方程式GEE。 In statistics, a generalized estimating equation (GEE) is used to estimate the parameters of a generalized linear model with a possible unknown correlation between outcomes. 上面的英文解释告诉我们,当我们

Codewar的博客 1万+

应对TensorFlow导入Keras时发生的错误问题

在应对TensorFlow导入Keras时发生的错误问题时,需要仔细分析错误的表现形式、原因以及解决方案。通过检查并更新TensorFlow和Keras的版本、重新安装相关软件、检查代码中的错误以及查阅官方文档和社区资源等方法,可以有效地解决这些错误问题。同时,使用虚拟环境来管理项目的依赖也是一个很好的做法,可以避免不同项目之间的依赖冲突。希望本文能够为您解决TensorFlow导入Keras时遇到的错误问题提供一些帮助。如果您还有其他问题或需要进一步的帮助,请随时与我们联系。

2408_88802129的博客 2979

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

keras中遇到的错误

在运行其他开源keras项目时,遇到了一些问题: 1、在导入_obtain_input_shape时 from keras.applications.imagenet_utils import _obtain_input_shape 出现错误如下: ImportError: cannot import name '_obtain_input_shape' 原因是在keras 2.2.2中,ke...

快乐咸鱼每一天 9229

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

python keras 加载.h5模型出现错误

OSError: Unable to open file (Truncated file: eof = 26583040, sblock->base_addr = 0, stored_eoa = 672267176) 错误描述: 情况说明:我自己网上下载好别人训练好的网络,保存模式是.h5格式,模型用tensorflow,keras训练的,我在重新加载模型并用自己的数据图像进行实验的时候,在keras加载model的时候报错, 网上方法尝试: 下载的模型不完整, 解决方法:重新下载模型,并且下载前

sophina_f的博客 4784

efm32 入门.pdf

本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。

Anaconda环境下keras导入错误:No module named ‘keras‘

今天在服务器上跑代码时遇到了keras导入错误:No module named ‘error’,如图所示: 但是conda list查看之后发现keras是正常安装了的,并且也尝试了从TensorFlow导入keras的方法,都失败了。 直接进入python命令行调试,同样失败 $ python Python 3.8.3 (default, Jul 2 2020, 16:21:59) >>> from keras import metrics Traceback (most recen

animalkun的博客 1万+

keras “normalize_data_format“ 相关错误

由于keras版本不同,"normalize_data_format"位置有变化,下面的两句都可以试试,不一定哪句是正确的位置~ 把对应导入的那句换成下面两句中的其中一句: from keras.utils.conv_utils import normalize_data_format from keras.backend.common import normalize_data_fo...

Markfieraloha的博客 7519

安装python3 keras 出现的错误

import keras Using Theano backend. ERROR (theano.sandbox.cuda): Failed to compile cuda_ndarray.cu: 'utf-8' codec ca n't decode byte 0xd5 in position 11: invalid continuation byte 突然安装keras会出现错误,如上,最后

hadxu的博客 4556

Tensorflow下调用keras数据集出现错误

from keras.datasets import imdb from keras.datasets import reuters 在anaconda3中使用tensorflow调用keras的数据集时,发现速度特别慢,甚至有时候会出现连接错误。 Downloading data from https://storage.googleapis.com/tensorflow/tf-keras-datasets/reuters.npz Traceback (most recent call last): F

qq_39624083的博客 2239

Keras错误记录

最近在跑一个深度学习的代码,基于TensorFlow后端的Keras框架,遇到了一下错误,记录解决一下: 1. softmax() got an unexpected keyword argument 'axis' 我的tensorflow版本是1.2.1,Keras版本是2.4.2(可以打开命令行窗口,输入 pip list 查看python库的信息) ...

dddmm123456的博客 657

ModuleNotFoundError: No module named ‘keras’错误

使用Jupyter notebook导入keras时,我遇到了这个错误,使用pip list和conda list查看也都有keras,可导入还是显示不存在。 解决方法o_o … 首先,在jupyter notebook里运行这玩意,结果发现竟然不是我的那个环境┑( ̄Д  ̄)┍,可是我是在有keras的环境中打开的jupyter啊。 import sys print(sys.version) 然后, conda pip install jupyter notebook 就完事了。至于为啥会打开在另一个环

枫林晚霞 967
上一篇: keras使用总结
下一篇: pytorch笔记
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值