11 2019 档案
摘要:1、RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 0. Got 342 and 281 in dimension 3 at /pytorch/aten/src/TH/generic/
阅读全文
摘要:前提: 模型参数和结构是分别保存的 1、 构建模型(# load model graph) model = MODEL() 2、加载模型参数(# load model state_dict) model.load_state_dict ( { k.replace('module.',''):v fo
阅读全文
摘要:解决方案有两种: 在命令行前指定编码 $ PYTHONIOENCODING=utf-8 python test.py hello world 你好,世界 在代码中指定编码 import io import sys sys.stdout = io.TextIOWrapper(sys.stdout.bu
阅读全文
摘要:卷积层: 参数:W:宽; H:高; D:深度; K:卷积核的个数; F:卷积核的大小; S:步长; P:用0填充 卷积后输出:W或H=[(输入大小-卷积核大小+2*P)/步长] +1. 不能整除时,一般去掉小数部分取整,如4.5,则取4 上图中的 output =[(7-3)+2*1]/1 +1 =
阅读全文
摘要:卷积神经网络中 channels 分为三种: (1):最初输入的图片样本的 channels ,取决于图片类型,比如RGB, channels=3 (2):卷积操作完成后输出的 out_channels ,取决于卷积核的数量。此时的 out_channels 也会作为下一次卷积时的卷积核的 in_c
阅读全文
摘要:1、第一步:备份原来的源文件 cd /etc/apt/ 命令 cp sources.list sources.list.bak 将sources.list备份到sources.list.bak 第二步:替换源 sudo gedit sources.list打开文件,替换成阿里云文件即可 第三步:更新
阅读全文