tensorflow
好好好123456
喜欢编程
展开
-
ERROR: Could not find a version that satisfies the requirement notebook (from versions: none) 解决办法
1、提示如下错误:2、修改镜像源:原创 2023-06-22 10:10:46 · 705 阅读 · 0 评论 -
jupyter安装完成后运行代码没有反应
1、通过pip install tensorflow安装jupyter后,进入网页,输入代码执行时没有反应。3、通过命令安装:pip install notebook。2、主要原因是:没有安装notebook导致。原创 2023-06-21 19:51:43 · 2176 阅读 · 0 评论 -
tensorflow NameError: name ‘layers‘ is not defined解决办法
错误原因:tensorflow未加载layers。原创 2022-08-14 18:48:20 · 2746 阅读 · 0 评论 -
tensorflow AttributeError: ‘Sequential‘ object has no attribute ‘predict_classes‘解决办法
降级使用比TensorFlow2.5低的版本。使用tensorflow的版本和之前的不同导致。前面还能使用,为什么现在突然报错?原创 2022-07-31 15:50:07 · 271 阅读 · 0 评论 -
ValueError: Input 0 of layer dense is incompatible with the layer:...解决办法
形状不一致导致,加入x=tf.reshape(x,[-1,784])原创 2022-07-27 15:33:49 · 3077 阅读 · 0 评论 -
tensorflow2.3 SyntaxError: can‘t assign to function call 解决办法
主要原因tape后多加了一个括号。原创 2022-07-27 10:26:48 · 348 阅读 · 0 评论 -
tensorflow2.3 TypeError: ‘int‘ object is not callable解决办法
代码】tensorflow2.3TypeError'int'objectisnotcallable解决办法。原创 2022-07-24 14:47:48 · 151 阅读 · 0 评论 -
tensorflow2.3 彩色图片转为灰度图片方法
images准备转换的RGB张量。最后一个维度必须为3,必须包含RGB值。name名称(可选)原创 2022-07-24 11:50:59 · 688 阅读 · 0 评论 -
tensoflow2.3 cnn网络怎样有效的增加模型识别能力
因增加模型层数后容易产生过拟合,建议配合layers.MaxPooling2D((2,2))、layers.BatchNormalization(),layers.Dropout(0.3),使用,增加网络模型的表达能力。1、增加训练使用的数据集,如果说训练识别的难度比较大,种类多,超过过30种,建议增加数据集到1W以上。2、训练模型太简单,无法有效的表达训练内容。..................原创 2022-07-24 11:22:16 · 230 阅读 · 0 评论 -
深度学习中下载的gif图片判断及相同图片的判断方法 附代码
深度学习中下载的gif图片判断及相同图片的判断方法再深度学习中需要找很多数据集,但是有些数据及存在重复或混杂这gif图片,那我们怎么处理呢?原创 2022-06-30 00:34:21 · 370 阅读 · 0 评论 -
difference = cv2.error: OpenCV(4.5.5) :-1: error: (-5:Bad argument) in function ‘subtract‘
报错提示:difference = cv2.subtract(dir_image1 , dir_image2)cv2.error: OpenCV(4.5.5) error: (-5:Bad argument) in function ‘subtract’报错的位置:difference = cv2.subtract(dir_image1 , dir_image2)主要为传参问题,需要使用:dir_image1 = cv2.imread(dir_image1)读取传入图片。更改方法:问题解决....原创 2022-06-29 10:56:46 · 1322 阅读 · 0 评论 -
tensorflow2.3 InvalidArgumentError: jpeg::Uncompress failed.报错解决办法
训练自己数据集的时候经常报错:tensorflow2.3 InvalidArgumentError: jpeg::Uncompress failed[[{{node decode_image/DecodeImage}}]] [Op:IteratorGetNext]解决办法:训练前检测一下图片是否损坏:损坏图片自动删除,再次训练问题解决。.........原创 2022-06-28 15:09:17 · 620 阅读 · 1 评论 -
AttributeError: module ‘matplotlib’ has no attribute ‘figure’
修改前:修改为:import matplotlib.pyplot as plt修改后:原创 2022-06-19 16:42:46 · 2723 阅读 · 0 评论 -
如何用tensorflow board可视化训练过程的详细过程
进入train.py文件目录下,新建一个logs文件。tensorboard --logdir logs进入网站:http://localhost:6006/因为logs下无数据导致。新建一个summary:送数据:具体以上代码放置位置如下:运行train文件,生成logs:在web中选择对应logs,显示训练过程中的accuracy、loss。......原创 2022-06-18 19:57:43 · 773 阅读 · 0 评论 -
电影评论 ValueError: logits and labels must have the same shape ((None, 16) vs (None, 1))
电影评论报错如下:(logits.get_shape(), labels.get_shape()))ValueError: logits and labels must have the same shape ((None, 16) vs (None, 1))通过分析发现模型定义错误导致:前期模型:更改为:问题解决。原创 2022-06-05 12:18:51 · 868 阅读 · 0 评论 -
optimization_pass.cc:185] None of the MLIR Optimization Passes are enabled (registered 2)解决办法
ptimization_pass.cc:185] None of the MLIR Optimization Passes are enabled (registered 2)解决办法tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:185] None of the MLIR Optimization Passes are enabled (registered 2)主要原因,训练使用内存或显存不足:1、修改:Batch大小。2、修改每个加原创 2022-06-01 19:54:07 · 8316 阅读 · 2 评论