![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python
sweettea~
菜鸡AI选手,随手记录可行codes or tricks助力自己和别人~
展开
-
Python报错:RuntimeError: The ‘data‘ object was created by an older version of PyG.
Python报错:RuntimeError: The 'data' object was created by an older version of PyG.原创 2023-07-31 17:03:27 · 1471 阅读 · 3 评论 -
Python报错:IndexError: invalid index of a 0-dim tensor. Use `tensor.item()` in
Python报错:IndexError: invalid index of a 0-dim tensor. Use `tensor.item()` in原创 2023-08-08 10:36:16 · 965 阅读 · 0 评论 -
3步安装torch_geometric
安装torch_geometric原创 2023-03-10 16:46:11 · 556 阅读 · 1 评论 -
Python的类中函数方法相互调用的两种方式
Python的类中函数方法相互调用的两种方式原创 2023-01-05 17:37:13 · 4815 阅读 · 0 评论 -
操作ndarray元素:访问、删除、插入
操作ndarray元素:访问、删除、插入原创 2023-01-05 17:37:33 · 2536 阅读 · 0 评论 -
Python torch.topk() 函数用法
Python torch.topk() 函数用法原创 2023-01-05 17:37:56 · 661 阅读 · 0 评论 -
Keras model.predict输出的概率值转换为类别
Keras model.predict输出的概率值转换为类别原创 2023-01-05 17:38:51 · 4027 阅读 · 1 评论 -
PyTorch:Dropout 操作 torch.nn.Dropout()
PyTorch:Dropout 操作 torch.nn.Dropout()原创 2023-01-05 17:38:31 · 2338 阅读 · 0 评论 -
pytorch 如何拼接迭代的tensor
pytorch 如何拼接迭代的tensor原创 2023-01-05 17:39:23 · 615 阅读 · 0 评论 -
pytorch拼接函数:torch.stack()和torch.cat()详解
pytorch拼接函数:torch.stack()和torch.cat()详解原创 2023-01-04 17:25:13 · 4036 阅读 · 0 评论 -
pandas实现两个dataframe数据的合并:按行和按列
pandas实现两个dataframe数据的合并:按行和按列原创 2023-01-04 17:09:16 · 4826 阅读 · 0 评论 -
Python将张量tensor/列表list/numpy array/字典dict 保存到本地
Python将张量tensor/列表list/numpy array/字典dict 保存到本地原创 2023-01-04 17:04:32 · 876 阅读 · 0 评论 -
用numpy操作矩阵,上三角,下三角矩阵,对角化矩阵
用numpy操作矩阵,上三角,下三角矩阵,对角化矩阵原创 2023-01-04 16:56:43 · 1065 阅读 · 0 评论 -
python reshape函数参数-1(X.reshape(X.shape[0], -1).T)
python reshape函数参数-1(X.reshape(X.shape[0], -1).T)原创 2023-01-04 16:52:52 · 711 阅读 · 0 评论 -
Python报错:TypeError: load() missing 1 required positional argument: ‘Loader‘
Python报错:TypeError: load() missing 1 required positional argument: ‘Loader‘原创 2023-01-04 16:42:55 · 893 阅读 · 0 评论 -
sklearn中精确率、召回率及F1值得micro,macro及weighted算法
sklearn中精确率、召回率及F1值得micro,macro及weighted算法原创 2023-01-04 16:23:28 · 1040 阅读 · 0 评论 -
train_test_split()函数用法
train_test_split()函数用法原创 2023-01-04 16:05:04 · 1706 阅读 · 0 评论 -
ipykernel_launcher.py: error: unrecognized arguments: -f /home/
ipykernel_launcher.py: error: unrecognized arguments: -f /home/原创 2023-01-03 20:03:43 · 1387 阅读 · 0 评论 -
使用python networkx构建随机网络、规则网络
使用python networkx构建随机网络、规则网络原创 2023-01-03 20:03:58 · 1358 阅读 · 1 评论 -
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace原创 2023-01-03 20:03:26 · 232 阅读 · 0 评论 -
TypeError: can‘t convert CUDA tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory
TypeError: can‘t convert CUDA tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory原创 2023-01-03 20:03:38 · 479 阅读 · 0 评论 -
InvalidIndexError: (slice(None, None, None), None)
InvalidIndexError: (slice(None, None, None), None)原创 2023-01-03 20:04:33 · 2129 阅读 · 0 评论 -
python 将稀疏矩阵转换成普通矩阵
python 将稀疏矩阵转换成普通矩阵原创 2023-01-03 20:04:25 · 1006 阅读 · 0 评论 -
python中的extend功能
python中的extend功能原创 2023-01-03 20:04:27 · 22761 阅读 · 0 评论 -
AttributeError: ‘list‘ object has no attribute ‘shape‘
AttributeError: 'list' object has no attribute 'shape'原创 2023-01-03 20:04:40 · 4852 阅读 · 0 评论 -
理解F.dropout 和nn.ReLU(inplace=True)中inplace的作用
理解F.dropout 和nn.ReLU(inplace=True)中inplace的作用原创 2023-01-03 20:04:14 · 1931 阅读 · 0 评论 -
yaml.constructor.ConstructorError: could not determine a constructor for the tag ‘tag:yaml.org,2
yaml.constructor.ConstructorError: could not determine a constructor for the tag ‘tag:yaml.org,2原创 2023-01-04 15:52:43 · 997 阅读 · 0 评论 -
Word里mathtype公式显示不全
Word里mathtype公式显示不全原创 2023-01-02 13:56:53 · 2115 阅读 · 0 评论 -
pandas读取csv文件操作
pandas读取csv文件操作原创 2023-01-02 13:53:58 · 1060 阅读 · 0 评论 -
ValueError: Object arrays cannot be loaded when allow_pickle=False
ValueError: Object arrays cannot be loaded when allow_pickle=False原创 2023-01-02 13:47:42 · 217 阅读 · 0 评论 -
TypeError: loop of ufunc does not support argument 0 of type str which has no callable log method
TypeError: loop of ufunc does not support argument 0 of type str which has no callable log method原创 2023-01-02 13:42:47 · 758 阅读 · 0 评论 -
Python报错can‘t convert CUDA tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first
Python报错can't convert CUDA tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first原创 2023-01-02 13:40:31 · 1582 阅读 · 0 评论 -
Torch,Numpy,Pandas转换具体实例
Torch,Numpy,Pandas转换具体实例原创 2023-01-02 13:36:52 · 1462 阅读 · 0 评论 -
Torch,Numpy,Pandas转换
Torch,Numpy,Pandas转换原创 2023-01-02 13:25:53 · 210 阅读 · 0 评论 -
pandas实现对dataframe随机抽样、分层抽样
pandas实现对dataframe随机抽样、分层抽样原创 2023-01-02 13:15:36 · 1603 阅读 · 0 评论 -
np.round()用法,小数点四舍五入。
np.round()用法,小数点四舍五入。原创 2023-01-02 13:15:52 · 1011 阅读 · 0 评论 -
Python报错:ValueError: too many values to unpack
Python报错:ValueError: too many values to unpack原创 2023-01-02 13:16:38 · 2304 阅读 · 0 评论 -
用pandas读取csv文件的前n行
用pandas读取csv文件的前n行原创 2023-01-01 19:40:22 · 2354 阅读 · 0 评论 -
如何将GPU中list类型数据转移到CPU
如何将GPU中list类型数据转移到CPU原创 2023-01-01 19:37:29 · 2010 阅读 · 3 评论 -
Python报错:AttributeError: ‘numpy.ndarray‘ object has no attribute ‘iloc‘
Python报错:AttributeError: 'numpy.ndarray' object has no attribute 'iloc'原创 2023-01-01 19:32:16 · 4528 阅读 · 0 评论