- 博客(10)
- 收藏
- 关注
原创 莫烦pytorch教程中DQN代码IndexError: too many indices for array
最初代码:action = torch.max(actions_value, 1)[1].data.numpy()[0, 0] # return the argmax修改后代码:action = torch.max(actions_value, 1)[1].data.numpy()[0] # return the argmax参考:https://morvanzhou.g...
2019-12-29 14:36:07 719 2
原创 ubuntu 16.04安装gym
1.安装gym也要在虚拟环境下进行安装,对于虚拟环境的建立,使用conda,可以参考博客https://blog.csdn.net/qs17809259715/article/details/1037294782.第一次尝试:前提要先进入虚拟环境,然后使用如下命令sudo apt-get install -y python-numpy python-dev cmake zlib1g-dev...
2019-12-28 20:33:06 3567
原创 IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python
pytorch报错:IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number是你的torch版本的不同造成的。train_loss += loss.data[0] 是pytorch0.3.1版本代码,在0.4-0.5版本的pytorch会...
2019-12-28 10:40:39 286
原创 【pytorch】torch.utils.data.TensorDataset()原版与新版的差异
原版代码:torch_dataset = Data.TensorDataset(data_tensor=x, target_tensor=y)loader = Data.DataLoader( dataset=torch_dataset, # torch TensorDataset format batch_size=BATCH_SIZE, # mini b...
2019-12-27 21:36:38 6538
原创 爬取房天下二手房房价数据,进行线性回归预测
本次通过爬取房天下中烟台二手房房价数据,使用线性回归进行简单预测。具体代码如下:1.从房天下爬取烟台二手房数据信息from selenium import webdriverfrom bs4 import BeautifulSoupfrom selenium.webdriver.support.wait import WebDriverWaitimport pandas as pdi...
2019-12-27 16:51:10 2845 1
原创 ubuntu16.04下安装anaconda和pycharm安装
文章目录一.anaconda的安装二.pycharm的安装对于ubuntu16.04下,通过conda安装cuda和cudnn。以及安装GPU版的tensorflow和pytorch,可以参考以下博客。ubuntu16.04 通过anaconda建立虚拟环境,安装cuda9.0,cudnn7.1.2虚拟环境下,基于cuda9.0,cudnn7.1.2安装tensorflow和pytorch...
2019-12-27 16:32:58 1516
原创 虚拟环境下,基于cuda9.0,cudnn7.1.2安装tensorflow和pytorch
1.安装tensorflow(1)本身tensorflow的安装很简单,只需要pip或者conda就好,但是必须找到tensorflow,cuda,cudnn的对应关系。Version Python version Compiler Build tools cuDNN CUDAtensorflow_gpu-...
2019-12-27 16:14:51 536
原创 ubuntu16.04 通过anaconda建立虚拟环境,安装cuda9.0,cudnn7.1.2
1.anaconda建立虚拟环境及conda操作//env_name代表你想要建立的环境名字,-n表示名字conda create -n env_name python=3.6 //激活环境source activate env_name //退出环境source deactivate //删除环境conda remove -n env_name --all //查看co...
2019-12-27 11:52:01 4639 1
原创 ERROR: Could not install packages due to an EnvironmentError
anaconda下安装modin时候,报错ERROR: Could not install packages due to an EnvironmentError解决办法:原安装命令:pip install modin现安装命令:pip install --user modin解决方法很简单,就是在你的pip安装语句的install后面加上 --user即可。...
2019-12-04 09:53:58 419
原创 一行代码将Pandas加速4倍
使用Modin让Python发挥到极致,详细可以浏览:http://mp.weixin.qq.com/s?__biz=Mzg5ODAzMTkyMg==&mid=2247487570&idx=1&sn=60b54b55396fa0916ead15c2a5ac5f76&chksm=c069980ff71e1119e2735d10d885288da80559dd57c1...
2019-12-04 09:42:43 145
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人