![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
深度学习
coding_zhang
这个作者很懒,什么都没留下…
展开
-
Not JSON Serializable error tf2.0
背景:使用的模型需要转换成tflite,用tf.keras重写后,因为用到了tf.keras.activations operators 所以在model.save的时候会报错Not JSON Serializable error。应该是类型不支持,造成node json序列化失败。解决方法:1. 官方tf nightly build '2.0.0-dev20190802' 版本已经fi...原创 2019-10-29 10:37:21 · 430 阅读 · 0 评论 -
pytorch 和 keras padding对比
一、pytorch 相关torch.nn.Conv2d(in_channels, out_channels, kernel_size, stride=1, padding=0, dilation=1, groups=1, bias=True, padding_mode='zeros')其中padding_mode 有两种。默认值是‘zeros’,另一个是‘circular’(这种模式貌似...原创 2019-09-29 17:35:03 · 2578 阅读 · 0 评论 -
Efficient Dense Modules of Asymmetric Convolution for Real-Time Semantic Segmentation
论文地址:https://arxiv.org/pdf/1809.06323.pdf作者:Shao-Yuan Lo1 Hsueh-Ming Hang1 Sheng-Wei Chan2 Jing-Jhih Lin2 1 National Chiao Tung University 2 Industrial Technology Research Institute sylo95.eecs02@g2...原创 2019-07-27 19:05:29 · 1147 阅读 · 0 评论 -
学习过程中遇到的bug(持续更新)
错误:RuntimeError: CUDA error: unknown error解决方法:sudo rm -rf ~/.nv错误:RuntimeError: Failed to export an ONNX attribute, since it’s not constant, please try to make things (e.g., kernel size) s...原创 2019-07-26 18:55:36 · 5655 阅读 · 7 评论 -
RuntimeError: Failed to export an ONNX attribute, since it's not constant, please try to make things
这是一个Pytorch1.1版本pytorch模型转onnx的bug参考:https://blog.csdn.net/Cxiazaiyu/article/details/91129657解决方法:1.pip install -i https://pypi.tuna.tsinghua.edu.cn/simple torch==1.0.12.pip install -i https...原创 2019-07-26 13:00:38 · 2803 阅读 · 2 评论 -
DABNet: Depth-wise Asymmetric Bottleneck for Real-time Semantic Segmentation
论文地址:https://arxiv.org/pdf/1907.11357.pdf代码地址:https://github.com/Reagan1311/DABNet论文利用了depth-wise asymmetric convolution and dilated convolution 设计了DAB module(Depthwise Asymmetric Bottleneck),充分利用...原创 2019-07-30 15:17:11 · 1219 阅读 · 2 评论 -
Tensorboard could not bind to unsupported address family问题解决
背景:ubuntu 16.04下使用tensorboard报错Tensorboard could not bind to unsupported address family解决:tensorboard --logdir=/tmp/mnist/log/ --port 8023 --host 本机ip原创 2019-04-28 21:01:32 · 1985 阅读 · 0 评论 -
Expected object of scalar type Long but got scalar type Float
背景:训练模型的时候报错Expected object of scalar type Long but got scalar type Float解决:方法一:targets =torch.LongTensor(targets)方法二:targets = targets.to(self.device,dtype=torch.int64)...原创 2019-04-28 18:33:56 · 9455 阅读 · 1 评论 -
记录一次tensorflow cuda out of memory
背景:训练的时候cuda 报错out of memory解决:排查原因。基本out of memory就是显存不够了,batchsize 太大的原因。将batchsize改小了以后确实问题也解决了。但是让我疑问的是之前我跑程序的时候还没有任何问题。突然就out of memory.注:tensorflow 默认run的时候将显存全占。设置config就解决。config = tf...原创 2019-04-28 18:17:26 · 886 阅读 · 0 评论 -
tensorflow中tf.train.string_input_producer()方法
背景:最近用tensorflow读取大量的数据,为了高效读取数据,采用tf.train.string_input_producer()方法问题:tf.train.string_input_producer()中可以指定epoch这个参数,但是用的时候发现好像没法获取一个epoch是什么时候结束官方文档:https://www.tensorflow.org/api_docs/python/t...原创 2019-04-23 14:04:25 · 6164 阅读 · 0 评论 -
TFRecords 拆分
背景:由于之前已经生成了训练数据的tfrecords,需要对已经生成的tfrecords根据类别去按比例拆分。或者将一个大的tfrecors拆分成几个小的tfrecords。参考:https://stackoverflow.com/questions/54519309/split-tfrecords-file-into-many-tfrecords-files?rq=11. 将大的tfre...原创 2019-04-22 17:41:16 · 1424 阅读 · 0 评论 -
pytorch中计算准确率,召回率和F1值的方法
predict = output.argmax(dim = 1)confusion_matrix =torch.zeros(2,2)for t, p in zip(predict.view(-1), target.view(-1)): confusion_matrix[t.long(), p.long()] += 1a_p =(confusion_matrix.diag() / c...原创 2019-04-26 11:30:57 · 18825 阅读 · 2 评论 -
numpy 使用记录之numpy newaxis和numpy.where() 用法
1.numpy.where() 的用法详解官方文档:https://docs.scipy.org/doc/numpy/reference/generated/numpy.where.htmlnp.where(condition,x,y)满足条件输出x,不满足条件输出y。np.where(condition)如果只有条件没有x,y.则相当于np.asarray(condit...原创 2019-04-12 19:59:43 · 317 阅读 · 0 评论 -
python 管理GPU资源
背景:解决模型运行时GPU资源占用量等各种数据的统计解决办法:利用python库py3nvml官方文档:https://py3nvml.readthedocs.io/en/latest/github:https://github.com/fbcotter/py3nvml安装方式:(我的python版本是python3.5)pip install nvidia-ml-py3...原创 2019-04-10 13:59:19 · 1289 阅读 · 0 评论