自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 Python类的实例作为参数传入一个函数

Python类的实例作为参数传入一个函数,即使不返回这个实例,这个实例的属性的变化依旧会保留。一下是一个例子from tst5 import change_classclass func1: def __init__(self): self.a = 1 self.b = 2f1 = func1()v = 1print('before:', f1.a, v)change_class(f1, v)print('after:', f1.a, v)"""返

2021-05-06 15:16:12 4979 2

原创 ubuntu系统磁盘已满,导致系统无法启动

1.因为无法进入ubuntu系统桌面,所以要尝试进入tty1-tty6命令控制台,使用命令ctrl+alt+f1~f62.进入tty1-tty6界面后,登录自己的系统。输入用户名,密码即可3.首先输入命令,df -l 查看自己的磁盘是否确实已满。如果已满,磁盘会显示使用率100%。4.查看系统中的大文件有哪些。用这个命令查找容量在200MB或以上的大文件sudo find / -size +200000k -exec ls -lh {} ;或者sudo find / -type f -size

2021-04-29 10:57:35 5532

转载 将远程git仓库里的指定分支拉取到本地(本地不存在的分支)

2021-04-20 19:31:09 163

原创 NVIDIA-SMI has failed because it couldn‘t communicate with the NVIDIA driver.

用nvidia-smi查看一下,提示如下错误:NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.又用nvcc -V看了一下驱动还在,网上搜了一下,用下面的方法顺利解决了问题 ,参考:https://blog.csdn.net/hangzuxi8764/ar...

2020-09-28 14:58:17 135

原创 Ubuntu18.04安装

可以主要参照以下链接进行安装:https://blog.csdn.net/baidu_36602427/article/details/86548203(一个可能也需要注意的点,进入BIOS时,设置的启动模式要设为UEFI)但是需要注意参照https://www.cnblogs.com/masbay/p/10745170.html,在分区时一定要注意:点空闲盘符,点击+进行分区,分区如下1) efi:这个就是实现你双系统的原因了,这个就是用启动 ubuntu 的目录,里面会有系统的引导,这个文件其

2020-08-02 16:33:32 156

原创 pycharm调试出现SyntaxError: Missing parentheses in call to ‘exec’

要么文件名为code.py,要么文件夹名为code都有可能导致冲突,只需要把code改为其他一个不冲突的名字就可以了。

2020-07-14 12:08:06 1309

原创 Deep Learning State of the Art (2020) | MIT Deep Learning Series简单记录

视频地址:https://www.youtube.com/watch?list=PLrAXtmErZgOeiKm4sgNOknGvNjby9efdf&time_continue=12&v=0VH1Lim8gL8&feature=emb_logo记录针对自动驾驶的总结:自动驾驶的level2是human is responsible,level4是machine is responsible。对于自动驾驶衡量标准是看其能够行驶多少距离不出现问题。(重要)介绍了一种动态的优化

2020-07-03 21:18:28 594

原创 读取图片的5种方法比较

图片宽158,高242,3通道总结:除了PIL外,其他4种读取的图片格式均为’numpy.ndarray’格式;5种方法读取的图片维度都是(高,宽,通道数);5种方法读取图片像素值都是int类型。1. cv2.imreadimport cv2img = cv2.imread(path)print(type(img))print(img.shape)结果:<clas...

2020-05-06 13:29:12 479

原创 python下graphviz安装

参考:https://blog.csdn.net/fadai1993/article/details/82491657其中在 安装PyGraphviz时,遇到问题,由于我用的版本是python3.6,https://www.lfd.uci.edu/~gohlke/pythonlibs/#pygraphviz没有对应版本,而用pip安装又出现问题,于是按照 https://stackoverfl...

2019-03-19 22:39:48 1818

原创 https://github.com/fchollet/deep-learning-with-python-notebooks/blob/master/5.4-visualizing-what-con

对于https://github.com/fchollet/deep-learning-with-python-notebooks/blob/master/5.4-visualizing-what-convnets-learn.ipynb中的代码的解析grads = K.gradients(loss, model.input)[0]K.gradients作用是Returns the grad...

2018-12-15 18:12:59 16315 1

原创 注意图片读取时的维度

import cv2img_path = 'D:/JupyterWorkSpace/13.jpg' # 13.jpg的大小是178x218img = cv2.imread(img_path)print(img.shape)13.jpg如下但是程序输出的shape却是(218, 178, 3),也就是cv2.imread这个函数在读取图片时,长和宽是调换位置的...

2018-12-11 21:45:06 1043 1

原创 python中类的应用实例

import numpy as npclass Generate(object): def __init__(self): self.group_images() self.lock = figure # 这里只是把self.lock指向了figure这个函数,没有运行这个函数 self.z = with_bracket() d...

2018-10-29 19:05:10 744

原创 tf.where实例

import tensorflow as tfscore_threshold = 3x = tf.constant([[1],[2],[3],[4],[5]])index = tf.where(tf.greater(x, score_threshold))with tf.Session() as sess: y = sess.run(index) print(y)''...

2018-10-25 21:08:13 709

原创 keras_resnet.models.ResNet50样例

import tensorflow as tfimport keras_resnet.modelsimport numpy as npimport kerasx = np.ones([1, 239, 224, 3])inputs = keras.layers.Input(shape=(None, None, 3))resnet = keras_resnet.models.ResNet...

2018-10-23 21:58:46 4605 4

原创 word表格内容本来居中,重开后左对齐问题的解决办法

word表格中的内容本来是居中,重开Word后有时会变为左对齐。解决办法:为表格中的内容重新新建一个样式,点开下图中的地方,然后选择“将所选内容保存为新快速样式”就可以新建一个样式。...

2018-10-18 13:42:39 5440

原创 matplotlib和illustrator结合画论文图片

注意事项:1.matplotlib作图后保存的格式是eps格式时,illustrator有时候没办法打开这个eps文件,这时候就可以把图片保存成svg格式,再用Inkscape软件打开另存为emf格式,再用illustrator打开编辑。2.illustrator如果想把画板中的部分内容保存下来,由于illustrator保存时是把画板也保存下来的,所以就必须把画板调整成适当的大小,再保存,画...

2018-10-16 18:57:50 1441

原创 jupytor notebook运行时一定要restart

今天搞了一天的matplotlib的字体缺少的问题,缺少了宋体和Times New Roman这两个论文常用字体,于是想方设法要把这两种字体加到matplotlib中去,尝试了许多网上的方法,比如https://blog.csdn.net/u012111465/article/details/79430365https://blog.csdn.net/u012915691/article/de...

2018-10-14 22:29:25 1458

原创 matplotlib说明框中字体粗细

import matplotlib.pyplot as pltstyles=['normal','italic','oblique']weights=['ultralight', 'light', 'normal', 'regular', 'book', 'medium', 'roman', 'semibold', 'demibold', 'demi', 'bold', 'heavy', '...

2018-10-13 15:42:29 13867 2

原创 WGAN-GP代码修改

项目地址:https://github.com/igul222/improved_wgan_training用的是gan_64x64.py。问题1NameError: name 'xrange' is not defined解决方法:把所有xrange改为range就行。问题2Tensorflow Type Error: Value passed to parameter 'shap...

2018-10-04 19:51:21 3103 6

空空如也

空空如也

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

TA关注的人

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