自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 Expected object of type torch.cuda.DoubleTensor but found type torch.cuda.FloatTensor

在用深度学习模型跑文本分类任务时,运行模型时报这个错误了,检查发现传入模型的embedding_matrix的类型不是float,而是double,所以要做类型转换‘’’embedding_matrix = torch.from_numpy(embedding_matrix).float()‘’’...

2019-11-27 10:42:42 402 1

原创 ValueError:Target and input must have the same number of elements,target nelement(128)!=input neleme

在计算loss时报错,后来检查发现直接用得到的logits和y值计算BCELoss(), 但BCELoss不能输入logits,必须要把logits通过sigmoid转换为0~1区间的概率值,所以把loss函数改为crossentropy...

2019-11-27 10:37:37 4606

原创 在Linux服务器上pip安装torch失败,报错raise WantReadError() , raise ReadTimeoutError

报错内容报错原因 因为是从国外网站下载,速度太慢了,超时了解决方法 把源换成国内清华源pip install pip -Upip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simplepip install torch==0.4.1如果这样还是报错,可以多执行几次,知道执行成功...

2019-11-27 10:21:25 935

原创 csv.field_size_limit(sys.maxsize) OverflowError: Python int too large to convert to C long

在运行torchtext.data.TabularDataset()时报错:csv.field_size_limit(sys.maxsize) OverflowError: Python int too large to convert to C long在你电脑的某位置下的python3.X\Lib\site-packages\torchtext\utils.py脚本里将maxInt = s...

2019-11-06 10:23:22 3070 4

空空如也

空空如也

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

TA关注的人

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