
Coding
Jemary_
这个作者很懒,什么都没留下…
展开
-
记录一个可能与with torch.no_grad()有关的坑
记录一个可能与with torch.no_grad()有关的坑, PyTorch原创 2022-12-29 16:02:42 · 435 阅读 · 1 评论 -
AttributeError: ‘_IncompatibleKeys’ object has no attribute
很久在优快云写过东西, 今天被一个bug气到自己,太愚蠢了,记录一下。错误代码如下:# Error code!model = model.load_state_dict(state_dict_var)out = model(input)网上有一些问题是因为 存的model, 却用state_dcit()去load,或者反过来操作。这里的错误与以上不同,就是因为xxx.load_state_dict() 无需返回值接收。修正如下:# Correct code!model.原创 2021-11-09 21:08:29 · 1554 阅读 · 2 评论 -
anaconda目录迁移工作采坑记录
由于工作需要,对之前使用的anaconda环境进行了目录迁移工作。因为anaconda目录下存了很多的第三方库的安装包,所以mv需要很长时间。如果有些包不介意重新下载安装,可以提前删掉,目录如下:/anaconda3/lib/python3.7/site-packages/terminado本以为直接修改.bshrc文件中的路径就可以了,但实际上anaconda/bin 以及anac...原创 2020-04-18 12:10:01 · 894 阅读 · 0 评论 -
Tensorflow 1.X : tf.xx is deprecated, Please use tf.compat.v1.xx instead
首先,deprecated 需要用来通知想要使用TensorFlow当前版本的人,将来会发生什么,并给他们时间以适应。因此,官方不会删除这些消息。方法有两个:1.使用此私有API自己禁用from tensorflow.python.util import deprecationdeprecation._PRINT_DEPRECATION_WARNINGS = False...原创 2020-02-06 15:51:52 · 13716 阅读 · 6 评论 -
FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated
/tensorflow/python/framework/dtypes.py:526: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)t...原创 2020-01-31 22:40:24 · 829 阅读 · 0 评论 -
RuntimeError Expected tensor for argument #1 'input' to have the same device as tensor for argument
RuntimeError: Expected tensor for argument #1 'input' to have the same device as tensor for argument #2 'weight'; but device 1 does not equal 0 (while checking arguments for cudnn_convolution)记录一下bu...原创 2019-10-23 12:50:00 · 7736 阅读 · 0 评论 -
安装mongodb4.x版本的坑[windows]
在4.x的版本中,使用自定义安装无法成功!不考虑磁盘空间的话,直接默认下去就行。下面给出...一定程度上自定义的方法1.首选选择complete到下面界面中,把这两个目录改到非C盘下。注意一定要根目录,非根目录还是会出现和自定义安装一样的问题。后面的一路next就ok了。最后检查服务中安装成功。...原创 2018-12-19 21:32:59 · 449 阅读 · 0 评论 -
JS笔记
函数的两种声明方式function name(para){}var name = function(){}前者全局有效,后者在执行语句后才允许访问,相当于变量声明。全局变量和局部变量1.函数体内外区分2.在函数作用域内,var name 为局部变量;没有var 直接 name=val。视为全局变量对象的构建var obj = { na原创 2018-01-30 10:10:18 · 238 阅读 · 0 评论 -
[Spring]Could not autowire. no beans of xxx type found
@Autowired下面添加一句@SuppressWarnings("SpringJavaAutowiringInspection")问题解决。(本身报错也不影响执行?)可能是spring的命名机制支持不够完善.....原创 2018-08-12 10:08:00 · 255 阅读 · 0 评论 -
IDEA+SpringBoot 启动404
记录一下复杂一点的解决方法是下图 在spring-boot中启动不过归根结底原因应该是在依赖中去掉下面的scope。或者provided改成compile(没测试)原创 2018-08-11 10:15:59 · 633 阅读 · 0 评论 -
DataLoader windows平台下 多线程读数据报错 | BrokenPipeError: [Errno 32] Broken pipe | freeze_support()
DataLoader多线程读取数据使用DataLoader读取数据时,为了加快效率,所以使用了多个线程,即num_workers不为0,在windows下报了错误。DataLoader(trainset, batch_size=128, shuffle=True, num_workers=2) https://github.com/pytorch/pytorch/pull/5585...原创 2019-07-18 19:40:21 · 4757 阅读 · 7 评论 -
Mac Python3 下载数据时候的SSL错误的解决
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1051)>先放错误,从tensorflow下载MNIST数据集的时候报了上述错误。查了好...原创 2019-03-27 22:38:06 · 2014 阅读 · 1 评论