自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(41)
  • 收藏
  • 关注

原创 Exception has occurred: RuntimeError xCUDA error:device-side assert triggeredCompile with `TORCH USE

Exception has occurred: RuntimeError xCUDA error:device-side assert triggeredCompile with `TORCH USE CUDA DSA`to enable device-side assertions

2024-06-30 21:11:18 170

原创 Exception has occurred: RuntimeError xCUDA error: no kernel image is available for execution on the

Exception has occurred: RuntimeError xCUDA error: no kernel image is available for execution on the deviceCompile with `TORCH USE CUDA DSA` to enable device-side assertions

2024-06-30 21:03:29 139

原创 OpenpyxlWriter‘ object has no attribute ‘save‘

将实验结果保存为EXCEL,报错“OpenpyxlWriter‘ object has no attribute ‘save‘”writer.save() 替换为 writer._save()

2023-09-19 20:02:57 3125 2

原创 【MATLAB】安装 shared_slreportgen_reportexplorer_common 时检测到以下错误

然后也可以把simulink和DSP以及signal processing 相关的toolbox全部不勾选(推荐)(来自:https://ask.csdn.net/questions/7624864)这两个工具箱没有其实没啥大的影响,就是信号处理这块的增强功能没有了。下载matlab的时候以及安装的时候关闭杀毒软件。

2023-09-19 15:25:07 313

原创 ValueError: Could not interpret optimizer identifier: <keras.optimizers.optimizer_v2.nadam

【代码】ValueError: Could not interpret optimizer identifier: <keras.optimizers.optimizer_v2.nadam。

2023-09-10 19:11:32 1367

原创 Python Padding

【代码】Python Padding。

2023-09-08 16:42:56 96

原创 python逐行读取与逐行写入txt文件

参考:https://blog.csdn.net/weixin_42599499/article/details/109250486。

2023-09-08 15:07:49 524

原创 Overleaf插入作者照片以及简介

通过以下命令在文末\end{document} 前 插入作者照片以及简介,不需要添加宏包。

2023-07-15 17:29:26 848

原创 python list列表合并/相加

python list合并

2022-11-21 09:48:46 812 1

原创 Pytorch tensor转numpy

pytorch tensor转numpy

2022-11-20 09:53:05 761

原创 什么是归纳偏置(Inductive bias)

归纳偏置

2022-10-04 09:45:20 177

原创 python对数组元素/索引安元素大小进行排序

对数组元素/索引进行排序

2022-10-02 14:43:41 1529

原创 tensorflow2.X 中tensor转为numpy

报错:NotImplementedError: Cannot convert a symbolic Tensor (functional_1/conv_/truediv:0) to a numpy arra解决方法:import tensorflow as tf Test = tf.Variable(10, dtype=tf.int32) with tf.compat.v1.Session() as sess: sess.run(tf.compat.v1.global_variab

2022-03-29 21:08:21 2104

原创 tf.keras计算FLOPs

FLOPs全称是floating point operations的缩写,翻译过来是浮点运算数,理解为计算量,常用来衡量算法或深度学习模型的计算复杂度。#浮点运行次数#FLOPS:注意全大写,是floating point operations per second的缩写,意指每秒浮点运算次数,理解为计算速度。是一个衡量硬件性能的指标。#FLOPs:注意s小写,是floating point operations的缩写(s表复数),意指浮点运算数,理解为计算量。可以用来衡量算法/模型的复杂度。#In

2022-03-29 11:11:56 2544

原创 Python将任意二维数组随机置0

Python将任意二维数组打乱顺序a=np.array([[6,0,2],[3,4,0],[0,0,5]])print(‘a:’, a)plt.imshow(a,cmap='jet')plt.figure()plt.show()idx, idy = np.where(a!=0)state = np.random.get_state()np.random.shuffle(idx)np.random.set_state(state)np.random.shuffle(idy)b=n

2022-02-19 20:11:01 1766

原创 扩充图像的边界-镜像

原始图片方法1:import cv2import matplotlib.pyplot as pltimg1 = cv2.copyMakeBorder(img,Xup,Xdown,Xleft,Xright,cv2.BORDER_REFLECT)#Xup,Xdown,Xleft,Xright分别表示向上、向下、向左和向右镜像几个像素plt.imshow(img1)plt.figure()plt.show()1、img1 = cv2.copyMakeBorder(img,50,0,0,0,

2022-02-18 09:25:24 2779 1

原创 解决Keras模型加载速度慢

解决Keras模型加载速度慢原始模型加载和保存原始模型保存 model.save('model{0}.h5'.format(n_model))原始模型加载models= load_model('model{0}.h5'.format(ix)) 解决方法1改进模型保存model.save_weights('model.h5')model_json = model.to_json()with open('model.json', "w") as json_file: json_file

2022-02-17 11:44:31 1443

原创 解决model.predict()慢

以我跑过的模型为例:原始model.predictclock1 = time.time()Y_pred = model.predict(X_test)print('model.predict(X_test) time is',time.time() - clock1, 's')输出:model.predict(X_test) time is 880.3435561656952 s解决方法1clock2 = time.time()Y_pred = = model(X_test, tr

2022-02-17 10:30:28 2545

原创 键盘突然失灵-解决方法:卸载->重启

解决方法:卸载->重启,具体操作如下:1、右键“此电脑”-管理“”2、“设备管理器”->右键“HID Keybpoard Device”选择“卸载设备;最后重启电脑即可。

2022-01-14 20:25:02 891

转载 pytorch中net.eval() 和net.train()的使用

参考链接:https://www.jianshu.com/p/822d9ae0169d

2022-01-06 14:28:46 1955

原创 .update()

.update()方法详解第一种:A.update(B):把字典B添加到字典A中A= {'Name': 'Zara', 'Age': 7}B = {'Sex': 'female' }A.update(B)print(A)输出结果{'Name': 'Zara', 'Age': 7, 'Sex': 'female'}第二种:A.update(B):用 update 更新字典 a,会有两种情况:(1)有相同的键时:会使用最新的字典 b 中 该 key 对应的 value 值。(2)有新

2022-01-05 19:54:14 2051

原创 RuntimeError: cublas runtime error : unknown error at C:/w/b/win…cu:225

**## 报错**## 分析原因GPU不够用,把数组改小就可以正常运行或者改为在CPU上运行

2022-01-04 21:49:21 731 1

原创 ENVI App Store

ENVI APP Store

2021-12-29 20:21:30 3319

原创 setattr(self,k,v)相当于self.k = v

setattr(self,k,v)相当于self.k = v

2021-12-23 14:16:02 453

原创 Python安装Github下载的包,以SimpleCV为例

1、去GitHub下载:https://github.com/Z-Zheng/SimpleCV2、把下载文件放到我刚刚那个文件夹下解压3、进入文件夹,打开cmd进入这个文件夹目录,激活环境:activate 环境名执行:python setup.py install

2021-12-17 22:28:35 4410 2

原创 AttributeError: module ‘tensorflow‘ has no attribute ‘placeholder‘

原因:TF1.X的代码在TF2.X环境下运行解决方法:将import tensorflow as tf改为:import tensorflow.compat.v1 as tftf.disable_eager_execution()

2021-12-16 10:50:23 1862

原创 TensorFlow2.X 和 1.X不同导致的报错

TensorFlow2.X 和 1.X不同导致的报错一、TensorFlow1.X :model = Model(input=[inputs], output=output)报错信息:TypeError: ('Keyword argument not understood:', 'input')解决方法,换成TensorFlow2.X :model = Model(inputs=..., outputs=...)二、TensorFlow1.X :from keras.models

2021-12-10 15:38:07 1177

原创 TypeError: (‘Keyword argument not understood:‘, ‘input‘)

原代码model = Model(input=[inputs], output=output)报错信息TypeError: (‘Keyword argument not understood:’, ‘input’)解决方法model = Model(inputs=..., outputs=...)

2021-12-10 15:29:18 6454 3

原创 TypeError: (‘Keyword argument not understood:‘, ‘dim_ordering‘)

TypeError: (‘Keyword argument not understood:’, ‘dim_ordering’)问题描述from tensorflow.python.keras.layers import Conv2DConv2D(24, 5, 5, padding='same',init='he_normal', input_shape = (target_Width,target_Height, 3),dim_ordering="tf")报错:TypeError: ('Key

2021-12-10 15:17:43 3379

原创 AttributeError: module ‘tensorflow‘ has no attribute ‘GPUOptions‘

AttributeError: module ‘tensorflow’ has no attribute ‘GPUOptions’报错原因Tensorflow 1.X和 2.X不兼容。Tensorflow 1.X:gpu_options = tf.GPUOptions(per_process_gpu_memory_fraction)Tensorflow 2.X:gpu_options =tf.compat.v1.GPUOptions(per_process_gpu_memory_fractio

2021-12-10 14:50:07 5245 1

原创 【安装torchsummaryX】

安装torchsummaryX时出现ERROR: Could not install packages due to an OSError: [Errno 2] No such file ……\\site-packages\\numpy-1.21.2.dist-info\\METADATA'执行如下命令:pip install torchsummaryX报错如下:“Requirement already satisfied: numpy in c:\users\cdb.conda\envs\pyt

2021-11-24 19:17:36 4522

原创 边缘保留滤波(EPF)

一、EPF高斯模糊只考虑了权重,只考虑了像素空间的分布,没有考虑像素值和另一个像素值之间差异的问题,如果像素间差异较大的情况下(比如图像的边缘),高斯模糊会进行处理,但是我们不需要处理边缘,要进行的操作就叫做边缘保留滤波(EPF)二、EPF的操作具体有两种做法:1、高斯双边模糊(类似磨皮效果)def bi_demo(image): ''' 高斯双边模糊: #i...

2019-03-14 15:20:26 3396

原创 ValueError: operands could not be broadcast together with shapes (204,111104

报错A=(D*W)ValueError: operands could not be broadcast together with shapes (100,3) (3,1)解释:本人出现的问题是,D,W的大小分别为(100,3) (3,1), 是<type ‘list’>、<numpy.ndarray>类型,而不是类型,直接进行乘积C = AB, 之后,提示上述...

2019-03-07 21:38:54 2597

原创 AttributeError: 'NoneType' object has no attribute '. inbound. nodes

问题:原因:tensorflow的代码和keras的代码不兼容解决方法:右边是在左边的代码的基础上改进的,加了一个tensorflow代码的函数,所以把函数中tensorflow代码的样式改成keras就解决了。...

2019-02-27 21:12:14 1938

原创 TypeError: Failed to convert object of type class 'list' to Tensor. Contents: [Dimension(None), -1

问题:解决方法:tf.reshape(max_pool, [batch_num, -1])改为tf.layers.flatten(max_pool)

2019-02-27 16:57:07 11912

原创 使用scipy.io.loadmat()时报错:KeyError:‘Image_gt’

问题解决方法:最终可运行代码:

2019-02-22 09:59:51 3529 13

原创 ValueError: setting an array element with a sequence.

原因将list转换为numpy.array时,出现list的某一个维度上元素的个数不一致,就会转换失败。解决方法请确保list的shape一致,也就是是一个矩阵。

2019-01-26 20:49:13 7618 1

原创 ENVI用ROI进行裁剪

有时需要裁剪一副多波段图像不同波段图像的相同区域,或裁剪一副图像对应的ground truth时,这时就需要用到ROI进行裁剪。步骤如下: 1. 首先打开你要裁剪的遥感图像。找到ROI工具,在快捷栏中直接找到roi工具,单击; 2. 在兴趣区域右击选择Retangle Size, 可以精确调整裁剪像素大小。然后点击OK,并把Region of Interest框关闭(否则不能完成下一步裁剪...

2018-08-29 13:25:56 44938 15

原创 tensorflow reduction_indices理解

在tensorflow的使用中,经常会使用tf.reduce_mean,tf.reduce_sum等函数,在函数中,有一个reduction_indices参数,表示函数的处理维度,直接上图,一目了然: 需要注意的一点,在很多的时候,我们看到别人的代码中并没有reduction_indices这个参数,此时该参数取默认值None,将把input_tensor降到0维,也就是一个数。参考:...

2018-08-18 18:34:51 188

原创 卷积的三种形式: valid,same,full

A:image; K:filter 设 A(image)的大小是7x7,K(filter)的大小是:3x3 1.valid Matlab代码实现:convn(A, K, ‘valid’) 2、same Matlab代码实现:convn(A, K, ‘same’) 3、full Matlab代码实现:convn(A, K, ‘full’)...

2018-08-04 22:28:18 3759

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除