
新知识
一只小白在路上
吾生也有涯,而知也无涯,
展开
-
2021-07-26
元素去重 import itertools label = [k for k,g in itertools.groupby(list('AAAABBBCCDAABBB'))] print(label)原创 2021-07-26 15:29:06 · 132 阅读 · 0 评论 -
报错总结1
import numpy as np indices = "hongnngn" target = np.zeros(shape=(5,),dtype=np.long) target[:6]= indices print(target) ValueError: invalid literal for int() with base 10: 'hongnngn' indices = [1,2,4,5,7] target = np.zeros(shape=(10,),dtype=np.long) tar.原创 2021-07-24 12:58:33 · 146 阅读 · 0 评论 -
2021-07-20
问题 可视化网络时,出现下面错误 RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor) should be the same 解决方法 原因:可视化网络使用的时cpu 将网络转成cuda net = CRNN(num_classes=1000) 修改后 net = CRNN(num_classes=1000) net.cuda() ...原创 2021-07-20 15:39:53 · 141 阅读 · 0 评论