- 博客(34)
- 资源 (4)
- 收藏
- 关注
原创 阿里云服务器urllib [Errno -2] Name or service not known
root用户下cd /etc/resolv.conf添加nameserver 8.8.8.8
2022-03-24 10:42:21
840
转载 电脑URL证书过期问题(已解决)SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate
下载https://letsencrypt.org/certs/lets-encrypt-r3.pem修改.pem后缀为.rec安装证书参考地址
2021-10-28 12:23:07
991
1
原创 pandas Dataframe 显示行列不全(已解决)
#设置整体宽度pd.set_option('display.width', 1000)#显示所有列pd.set_option('display.max_columns', None)#显示所有行pd.set_option('display.max_rows', None)#单位列的显示长度,默认为50pd.set_option('max_colwidth',100)
2021-07-29 10:29:06
463
原创 tensorflow2.版本更新导致的1.x的问题
import tensorflow as tftf.reset_default_graph()module ‘tensorflow’ has no attribute ‘reset_default_graph’tf.reset_default_graph()修改为tf.compat.v1.reset_default_graph()module ‘tensorflow’ has no attribute ‘placeholder’tf.placeholder修改为tf.compa...
2021-07-10 18:07:01
988
原创 使虚拟机支持SSH转发X图形界面
使用虚拟机打开ds9时产生错误:Application initialization failed: no display name and no $DISPLAY environment variable Unable to initialize window system.解决方案:vim /etc/ssh/sshd_configAllowTcpForwarding yes X11Forwarding yes修改完成后,重启SSHD 服务service sshd restart...
2021-07-09 20:53:36
710
原创 tensorflow have no attribute placeholder
tf.placeholder()改为tf.compat.v1.placeholder()并添加语句tf.compat.v1.disable_eager_execution()
2021-05-09 16:44:39
393
2
原创 module ‘tensorflow‘ has no attribute ‘app‘
tf 2.x已经移除了这个组件tf.app 改为 tf.compat.v1.app
2021-05-09 16:40:02
2492
2
原创 iraf ds9 display:Cannot open device (node!imtool,,512,512)
手动打开windows里的ds9是不行的,要在iraf里打开,两个命令:xgterm & opens the IRAF command windowds9 & opens DS9, which IRAF will use to display image files when you ask it to
2021-05-08 21:01:42
711
原创 latex三行表格,增加行距,表格线加粗,固定表格位置
宏包\usepackage{multirow}%表格\usepackage{booktabs} \renewcommand{\arraystretch}{1.8} \begin{table}[] \centering \begin{tabular}{ccccccc}% \hline \toprule[1.1pt] \multicolumn{2}{c}{\textbf{样本容量}} & N=1 & N=5 & N=10 & N=30 &
2021-05-08 13:32:17
2638
原创 jupyter Notebook/Lab显示行号
Jupyter Notebook点击View->Toggle Line NumbersJupyter Lab点击View->Show Line Numbers
2021-05-08 11:21:36
3784
原创 matplotlib.pyplot plt.hist() 绘制概率图时,概率和不为1的问题(已解决)
数据是10,000个随机投掷的骰子uni_data = np.random.randint(1, 7, 10000)直方图直接用density=1,y轴的概率值是不对的方法一:用bins修正,同时修正了x刻度对不齐的问题plt.hist(uni_data,bins=np.arange(0.5, 7.5), edgecolor='w',density=1) 方法二:给bins增加权重(参考)weights = np.ones_like(uni_data )/float(len(uni_
2021-04-24 17:24:54
4302
原创 matplotlib.pyplot plt.hist()画直方图时x坐标刻度和图不对齐的问题(已解决)
我的数据是随机投掷10,000次骰子uni_data = np.random.randint(1, 7, 10000)画直方图plt.hist(uni_data,edgecolor='w',density=1)plt.show()tcl柱子和图对不齐,解决:修改bins和x范围plt.hist(uni_data,bins=np.arange(0.5,7.5), edgecolor='w',density=1) #这里的6是plt.xlim(0,6)plt.show()ps:(0.5
2021-04-24 16:58:29
8450
原创 win10+anaconda+cuda10.1+cudnn7.6.5+tensorflow-gpu=2.3.0安装成功
写在前面:我的cuda10.1+cudnn7.6.5安装好后,在Anaconda的base环境里安装了tensorflow-gpu=2.3.0,但不管怎么尝试tensorflow都不用gpu,晚上灵机一动发现windows终端cmd里nvcc -V显示是正确的Anaconda Prompt的base环境里nvcc -V不是内部命令或外部命令,也不是可运行程序然后我才突然意识到,base环境可能也是一个虚拟环境?我的cuda+cudnn是安装在windows里的,并没有安装到base环境下,然后想起下
2021-04-13 00:28:50
628
1
原创 压缩包安装fitter库,gbk编码错误解决方法
安装fitter库直接pip和conda install都安装不了(不知道为什么,反正找不到在https://pypi.tuna.tsinghua.edu.cn/simple/fitter下载压缩包解压文件夹控制台cd到解压后的文件夹位置输入命令python setup.py install解决编码错误出现错误UnicodeDecodeError: 'gbk' codec can't decode byte 0xa6 in position 3273: illega
2021-04-08 16:46:36
941
原创 anaconda更换清华源
打开.condarc (路径:C:\Users\Administrator)修改内容为:channels: - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64 - http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/win-64 - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-6
2021-04-08 14:31:09
396
原创 在cmd终端输入python弹出Windows应用商店(已解决)
直接Cortana搜索“管理应用执行别名”关闭有关python的“应用安装程序”
2021-03-13 11:33:33
1925
1
原创 IDL光谱提取
发布资源里的IDL Workbench 7.0.6(1)和(2)包含所有资源IDL的天文包指引安装IDL运行IDL.zip.001用License替换安装路径下的Lisence如果没有JAVA运行环境,则还需运行JRE安装提取光谱DATA/即APO_UT150807/为处理数据,其中bias是背景噪声,flat是平场,arc是定标灯,obj是目标天体mkAPO/是为该问题编写的包,入口是d3prepare,astron/是一个标准包打开IDL->窗口->首选项->I
2021-01-23 17:28:22
989
1
原创 统计数据库字段和出现次数
SDSS DR16数据库select subclass,count(*) from SpecObj where zwarning = 0 and class = 'GALAXY' group by subclass结果
2021-01-23 17:04:34
822
原创 PDF不能复制或编辑:用Adobe acrobat将扫描版PDF转换为可编辑版本
问题描述:PDF文档很清晰,但内容是按块组织的,因此没法进行复制文本等操作。(可直接跳转方法二)工具和方法:Adobe Acrobat Pro DC,不包含可渲染的文本时:“增强页面”-“识别文本”-;“在本文件中”-“识别文本”;包含可渲染的文本时:直接识别文本会出现提示...方法一(不推荐)方法二(推荐)
2021-01-17 15:37:06
5275
原创 python numpy中array和mat类型矩阵乘法的三种方式比较(np.dot()、*、np.multiply())
import numpy as np# np.array()# 1. np.dot() 矩阵乘法a = np.array([[1, 2], [3, 4]])b = np.array([[1, 2], [3, 4]])c = np.dot(a, b)print(c)# 2. * 对应相乘d = a * bprint(d)# 3. np.multiply() 对应相乘e = np.multiply(a, b)print(e)# np.mat()# 1. np.dot() 矩.
2020-12-11 12:12:30
727
原创 python numpy计算矩阵特征值和特征向量
计算矩阵R的行列式b = np.linalg.det(R)计算矩阵R的特征向量和特征矩阵c = np.linalg.eig(R)其中特征值为c[0]特征向量为c[1]import numpy as np# w1为列向量x11 = np.array([[-3 / 4, -1 / 4, -1 / 8]]).Tx12 = np.array([[5 / 4, -1 / 4, -1 / 8]]).Tx13 = np.array([[5 / 4, -1 / 4, 7 / 8]]).T
2020-12-11 11:06:50
18893
4
原创 python numpy for循环矩阵乘法
把向量放到一个list中,用for i in list进行遍历循环数字时为for i in range(num)import numpy as np# 列向量乘行向量x1 = np.array([[1,2]]).Tx2 = np.array([[1,3]]).Tx = [x1, x2]res = 0for i in x: res += i * i.T;print(res)...
2020-12-11 10:34:53
3253
原创 python numpy定义矩阵行向量与列向量
import numpy as np# 定义行向量# Method1(直接定义)x1 = np.array([[-3/4,-1/4,-1/8]])print(x1)# Method2a = [[-3/4,-1/4,-1/8]]x2 = np.array(a)print(x2)# 定义列向量# Method1(直接定义)x3 = np.array([[-3/4],[-1/4],[-1/8]])print(x3)# Method2(利用行向量的Method1)x4 = x1.
2020-12-11 09:59:43
4123
原创 win10/CUDA10.2下theano配置GPU加速及一系列问题
已配置好theano 1.0.4、pygpu 0.7.6、CUDA 10.2、CUDNN等1. 测试目前theano使用cpu还是gpufrom theano import function, config, shared, tensorimport numpyimport timevlen = 10 * 30 * 768 # 10 x #cores x # threads per ...
2020-04-07 18:32:15
1701
8
原创 python读取天体fits数据,并用plt绘制图像
fits文件存储路径astropy.io.fits库读取fits信息import matplotlib.pyplot as pltfrom astropy.utils.data import get_pkg_data_filenamefrom astropy.io import fitsimage_file = get_pkg_data_filename('data/Hoag.fit...
2020-04-02 21:45:01
6978
原创 Keras库报错:ValueError: Negative dimension size caused by subtracting 2 from 1 for 'conv2d_1/convolutio
dim_ordering: One of {“th”, “tf”}. “tf” mode means that the images should have shape (samples, height, width, channels), “th” mode means that the images should have shape (samples, channels, height...
2020-04-02 10:02:18
1672
原创 opencv视频流|实现视频中的人脸检测
import cv2 detector = cv2.CascadeClassifier('D:\opencv-4.2.0\data\haarcascades\haarcascade_frontalface_default.xml')#打开笔记本摄像头video_capture = cv2.VideoCapture(0)while True: #读视频帧 ret, im...
2020-03-24 15:09:25
921
原创 opencv视频流|videoCapture()读取和处理(灰度、镜像、捕捉保存)
OpenCV调用笔记本内置摄像头import cv2#调用笔记本内置摄像头,参数为0,如果有其他的摄像头可以调整参数为1,2capture = cv2.VideoCapture(0)while True: #从摄像头读取图片 sucess,img=capture.read() #显示摄像头 cv2.imshow("iLucAs",img) ...
2020-03-24 12:58:25
4112
原创 Spyder中opencv实现人脸识别error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor'
错误:原因:图片路径中存在中文debug方式:修改图片路径
2020-03-24 10:56:10
938
原创 MATLAB实现SRCNN图像重建算法
原论文和源代码图像被转化到 YCbCr 色彩空间,并只使用亮度通道Y,原因在于相较于色差,人类视觉对亮度变化更为敏感。修改过的代码将最终输出图像合回彩色。验证“将R,G,B格式转换为YCbCr,只计算Y分量(亮度分量),结果会比直接计算要高几个dB。”目录...
2020-03-24 09:36:59
1895
原创 虚拟机Centos7添加中文输入
安装好的centos系统默认是没有中文输入法的,只能输入英文字符。打开系统设置选择地区和语言,添加输入源选择汉语(中国)选择汉语(Intelligent Pinyin)4. 在任务栏切换输入法,即可在终端输入中文(Firefox同理)...
2020-03-10 12:43:03
1810
原创 生成cvs文件的方法(以ORL数据库为例)
已下载好的ORL数据库文件存储路径为D:\ORL网上查找到的方法都是在cmd界面输入D:\ORL>dir /b/s *.bmp > at.txt但我的系统提示解决方法先cd到ORL文件所在目录再执行指令,即D:cd ORLdir /b/s *.bmp > at.txt执行结果在D:\ORL下生成文件at.txt...
2020-03-08 10:38:01
713
原创 CASA|将.fits文件转换为.image文件
转换为model_file = '/usr/local/tools/casa/ppmodel_image_93GHz'importfits( fitsimage = model_file+'.fits', imagename = model_file+'.image')
2020-03-07 15:33:17
702
原创 VMware虚拟机CentOS 7 系统安装通用天文包CASA 教程
准备工作(安装软件版本可按需下载,本文以我所下载的版本作参考)安装VMware workstation (我的是15.5.1)链接:https://pan.baidu.com/s/1E-fxWoFRmoBgAXGV9vUpmA提取码:qqqg下载Linux虚拟机镜像(我下载的版本打了个勾)下载地址http://mirrors.163.com/centos/7/isos/x86_64/...
2020-03-03 15:39:57
1783
IDL WorkBench 7.0.6(2).zip
2021-01-23
SRCNN算法的MATLAB实现及一些个人尝试.zip
2020-03-23
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人