自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 ImportError: libtorch_cuda_cu.so: cannot open shared object file: No such file or directory,mmdet安装报

安装torch torchvision时一定要记住时按章cuda10.2,(我报错的原因就是因为装的是cuda11.3)github前面说了,没注意导致后面mmcv和mmdet一直报错。正确方法:注意一定要按照顺序,先手动安装MMDetection,再回头上一层文件夹,执行下面的命令。指定mmdet版本安装(错误方法,他指定了只能按照文档介绍的方式安装,不能用pip)安装之前强制更新了一下conda要不然一直报setuptools那个错误,gcc安装 c-compiler。指定mmcv版本安装。

2023-09-04 10:44:23 3004

原创 pytorch-geometric安装过程 出现libcudart.so.10.2 问题

pytorch-geometric安装过程 出现libcudart.so.10.2 问题。

2022-10-17 19:46:35 466

原创 服务器查找数据并复制

服务器使用复制文件

2022-10-08 09:25:07 132

原创 Attention学习笔记

注意力机制学习代码

2022-04-10 21:33:37 556

原创 python - ValueError: source code string cannot contain null bytes

sed -i ‘s/\x0//g’ <目标文件>https://www.it1352.com/716505.html

2021-12-11 09:39:43 826

原创 分类任务中 一些函数 acc 、roc、混淆矩阵

from sklearn.metrics import roc_curve,aucfrom prettytable import PrettyTableclass ConfusionMatrix(object): """ 注意,如果显示的图像不全,是matplotlib版本问题 本例程使用matplotlib-3.2.1(windows and ubuntu)绘制正常 需要额外安装prettytable库 """ def __init__(self, nu

2021-09-21 10:42:09 505

原创 钙化项目整理流程 1-dicom 解析帧和数据集划分

第一步 数据集介绍 准备工作文件夹6GCCS 原始dicom 数据每一个代表一个患者这里代表六个切面上面为dicom数据,下面是处理过程中需要舍弃的用来当做三个切面的存储主目录患者的划分:patienti_split.ipynb患者名单 GCCS名单.xlsx 如下图所示以ID后两位 作为患者的唯一标识,钙化指数和冠脉狭窄程度是需要预测的标签,狭窄程度每十分一个程度(经过尝试,无法直接预测出),目前针对钙化指数进行预测import osimport SimpleITK

2021-09-16 19:10:25 280

原创 Self-training with Noisy Student improves ImageNet classification

2021-09-13 11:29:42 92

原创 科研绘图配色

来源:https://www.youtube.com/watch?v=pymCMc4e8fE

2021-08-23 23:35:20 884

原创 linux服务器使用笔记(个人)

clash运行命令:./clash -d./config.yamlinterval 调小一点ghelp.yaml 节点出错选择能正确连接的订阅,

2021-08-10 21:05:34 766

原创 medical image analysis 笔记2

AI for medical image analysis2.Counting labels 课程代码避免类不平衡影响损失函数的一种方法是对损失进行不同的加权。要选择权重,您首先需要计算类别频率。对于本练习,您将只获得每个标签的计数。稍后,您将使用此处练习的概念来计算作业中的频率!# Import the necessary packagesimport numpy as npimport pandas as pdimport seaborn as snsimport matplotli

2021-07-09 14:34:27 203

原创 medical image analysis 笔记1

AI for medical image analysis1.Data Exploration 课程代码在本课程的第一个作业中,您将使用从公共 ChestX-ray8 数据拍摄的胸部 X 射线图像。在本笔记本中,您将有机会探索此数据集并熟悉将在第一次评分作业中使用的一些技巧在开始为任何机器学习项目编写代码之前,第一步是探索您的数据。用于分析和操作数据的标准 Python 包是 pandas。使用接下来的两个代码单元格,您将导入 pandas 和一个名为 numpy 的包用于数值操作,然后使用 pa

2021-07-09 09:03:36 577

原创 efficientnet 代码

efficient代码笔记来源 :https://github.com/WZMIAOMIAO/deep-learning-for-image-processing/blob/master/pytorch_classification/Test9_efficientNetimport mathimport copyfrom functools import partialfrom collections import OrderedDictfrom typing import Optional,

2021-07-05 13:55:41 925 1

原创 从头开始使用 U-NET 实现语义分割

u-net结构图代码地址:https://github.com/aladdinpersson/Machine-Learning-Collection/tree/master/ML/Pytorch/image_segmentation/semantic_segmentation_unetmodel.pyimport torchimport torch.nn as nnimport torchvision.transforms.functional as TFclass DoubleConv(

2021-07-04 19:21:58 612

原创 Einsum: numpy,pytorch and Tensorflow

EINSUM IS ALL YOU NEED如果你和我一样,你会发现很难记住 PyTorch/TensorFlow 中用于计算点积、外积、转置和矩阵向量或矩阵矩阵乘法的所有不同函数的名称和签名。Einsum 表示法是表达所有这些以及对张量的复杂操作的一种优雅方式,本质上是使用特定于领域的语言。除了不必记住或定期查找特定库函数之外,这还有其他好处。一旦你理解并使用了 einsum,你将能够更快地编写更简洁高效的代码。当不使用 einsum 时,很容易引入不必要的张量整形和转置,以及可以省略的中间张量

2021-07-04 11:59:26 274

原创 Pytorch Quick Tip: Weight Initialization

pytorch_init_weightsExample code of how to initialize weights for a simple CNN network.# Importsimport torch.nn as nn # All neural network modules, nn.Linear, nn.Conv2d, BatchNorm, Loss functionsimport torch.nn.functional as F # All functions that do

2021-07-04 10:51:30 168

原创 Pytorch Quick Tip: Using a Learning Rate Scheduler

学习率策略如何使用简单的学习率调度程序的示例代码,在这种情况下,使用学习率调度程序在 MNIST 数据集上进行(非常)小而简单的前馈网络训练。在这种情况下,使用 ReduceLROnPlateau 调度程序,但可以轻松更改为任何其他可用的调度程序。# Importsimport torchimport torch.nn as nn # All neural network modules, nn.Linear, nn.Conv2d, BatchNorm, Loss functionsimpor

2021-07-04 10:47:30 114

原创 Reproducible Results and Deterministic Behavior

设置随机种子import random, torch, os, numpy as npdef seed_everything(seed=42): os.environ['PYTHONHASHSEED'] = str(seed) random.seed(seed) np.random.seed(seed) torch.manual_seed(seed) # if using cuda torch.cuda.manual_seed(seed) tor

2021-07-04 10:31:01 60

原创 PyTorch Quick Tip: How to get a Progress Bar(进度条)

进度条import torchimport torch.nn as nnfrom tqdm import tqdmfrom torch.utils.data import TensorDataset, DataLoader# Create a simple toy dataset example, normally this# would be doing custom class with __getitem__ etc,# which we have done in custom dat

2021-07-03 21:13:06 662

原创 Calculate Mean and Standard Deviation of Data

import torchimport torchvision.transforms as transformsfrom torch.utils.data import DataLoaderimport torchvision.datasets as datasetsfrom tqdm import tqdmdevice = torch.device("cuda" if torch.cuda.is_available() else "cpu")train_set = datasets.CIFAR

2021-07-03 20:47:42 208

原创 Pytorch TensorBoard Tutorial

TensorBoard# Pytorch 1.4.0# pip install tb-nightly如何在 PyTorch 中使用 TensorBoard 的示例代码。这段代码使用了来自 TensorBoard 的许多不同的功能,并试图以紧凑的方式将它们全部包含在内# Importsimport torchimport torchvisionimport torch.nn as nn # All neural network modules, nn.Linear, nn.Conv2d,

2021-07-03 20:08:48 163

原创 PYTORCH COMMON MISTAKES

1.Didn’t overfit a single batchdata, targets = next(iter(train_loader))import torchimport torchvision # torch package for vision related thingsimport torch.nn.functional as F # Parameterless functions, like (some) activation functionsimport torchvis

2021-07-03 19:20:05 97

原创 How to deal with Imbalanced Datasets in PyTorch - Weighted Random Sampler Tutorial

处理imblance数据数据集两类:金毛100:哈士奇1Methods for dealing with imbalanced datasets:Oversampling即不同的数据增强Class weighting给少的数据集更大的权重loss_fn=nn.CrossEntrophyLoss(weight=torch.tensor([1,50,12...]))import torchimport torchvision.datasets as datasetsimport o

2021-07-03 16:51:00 256

原创 Albumentations Tutorial for Data Augmentation (Pytorch focused)

对比torchvision优势1.Faster than torchvision on every batch2.Support for more tasks like segmentation and detection which is a lot harder to do in torchvisionimages:cat_dogs:数据集每个文件夹里有相应的图片文件1.classification.pyimport cv2import albumentations as Aim

2021-07-03 16:15:10 216 5

原创 Pytorch Data Augmentation using Torchvision

介绍展示了如何在 CIFAR10 数据集上使用转换(可能不需要很多)以及在小型 CNN 网络上进行训练的小示例Shows a small example of how to use transformations (perhaps unecessarily many)on CIFAR10 dataset and training on a small CNN toy network.import torchimport torch.nn as nn # All neural network mo

2021-07-03 11:07:25 308

原创 How to build custom Datasets for Text in Pytorch

images文件夹下面为图像文件caption如下图所示imagefile ,caption目的我们想要转换文本 -> 数值我们需要一个将每个单词映射到索引的词汇表我们需要设置一个 Pytorch 数据集来加载数据设置每个批次的填充(所有示例都应该是排序好的相同的 seq_len 和设置 dataloader) # 注意,加载图像比文本更容易!mport os # when loading file pathsimport pandas as pd # for look..

2021-07-03 10:37:56 121

原创 How to build custom Datasets for Images in Pytorch

custom dataset文件目录如下所示cats-dogs-resized目录下文件cats_dogs.csv:文件名 和标签create class load datasetcustom_dataset.py 文件:如何在 Pytorch 中创建自定义数据集的示例。在这种情况下,我们在一个单独的文件夹中有猫和狗的图像,以及一个包含 jpg 文件名称和目标标签的 csv 文件(0 代表猫,1 代表狗)。# Importsimport torchimport torch.nn

2021-07-03 09:56:44 184

原创 pytorch_pretrain_finetune

introduction这是一个如何从 PyTorch 加载预训练模型 (VGG16) 的小示例,并对其进行修改以在 CIFAR10 数据集上进行训练。相同的方法可以很好地推广到其他数据集,但可能需要更改对网络的修改。# Importsimport torchimport torchvisionimport torch.nn as nn # All neural network modules, nn.Linear, nn.Conv2d, BatchNorm, Loss functionsi

2021-07-02 20:31:06 237 1

原创 How to save and load models in Pytorch

Save and load checkpoint of a model如何保存和加载模型检查点的小代码示例。这个例子没有执行任何训练。# Importsimport torchimport torchvisionimport torch.nn as nn # All neural network modules, nn.Linear, nn.Conv2d, BatchNorm, Loss functionsimport torch.optim as optim # For all Opti

2021-07-02 19:52:11 67

原创 pytorch_bidirectional_lstm

bidirectional LSTMExample code of a simple bidirectional LSTM on the MNIST dataset.Hyperparameters# Hyperparametersinput_size = 28sequence_length = 28num_layers = 2hidden_size = 256num_classes = 10learning_rate = 0.001batch_size = 64num_epochs =

2021-07-02 19:35:43 993

原创 pytorch_rnn_gru_lstm

pytorch_rnn_gru_lstmExample code of a simple RNN, GRU, LSTM on the MNIST dataset.

2021-07-02 19:26:47 147

原创 TransUNet: Transformers Make Strong Encoders for Medical Image Segmentation

transformer 用于医学图像分割原论文:TransUNet: Transformers Make Strong Encoders for Medical Image Segmentation摘要:在本文中,提出了 TransUNet,它兼具 Transformers 和 U-Net 的优点,可作为医学图像分割的强大替代方案。一方面,Transformer 将来自卷积神经网络 (CNN) 特征图的标记化图像块编码为用于提取全局上下文的输入序列。另一方面,解码器对编码特征进行上采样,然后将其与高

2021-07-02 16:01:08 702

原创 pytorch_simple_CNN

convolutional neural network (CNN)using the PyTorch librarymodelclass CNN(nn.Module): def __init__(self, in_channels=1, num_classes=10): super(CNN, self).__init__() self.conv1 = nn.Conv2d( in_channels=in_channels,

2021-07-02 09:45:15 443

原创 pytorch_simple_fullynet

Fully connected neural network simpleImportsimport torchimport torchvision # torch package for vision related thingsimport torch.nn.functional as F # Parameterless functions, like (some) activation functionsimport torchvision.datasets as datasets #

2021-07-01 23:38:52 80 1

原创 pytorch_tensorbasics

pytorch 学习tensorInitialization of a TensorTensor Mathematical Operations and ComparisonTensor IndexingTensor Reshaping

2021-07-01 23:24:24 128

原创 cat12mri输出文件

2020-03-16 20:05:41 394

原创 Latent feature representation with stacked auto-encoder for AD/MCI diagnosis

abstractUnlike the previous methods that considered simple lowlevelfeatures such as gray matter tissue volumes fromMRI, and mean signal intensities from PET, in this paper,we propose a deep learni...

2020-03-03 17:37:16 514

原创 多模态学习笔记

首先,什么叫做模态(Modality)呢?每一种信息的来源或者形式,都可以称为一种模态。例如,人有触觉,听觉,视觉,嗅觉;信息的媒介,有语音、视频、文字等;多种多样的传感器,如雷达、红外、加速度计等。以上的每一种都可以称为一种模态。同时,模态也可以有非常广泛的定义,比如我们可以把两种不同的语言当做是两种模态,甚至在两种不同情况下采集到的数据集,亦可认为是两种模态。因此,多模态机器学习,英文全...

2019-12-15 19:29:16 7317

原创 爬虫学习 5.17

5.20xpath 语法使用技巧1.用text() 获取文字信息2.通过url_infos = selector.xpath('//div[@class="article block untagged mb15"]') 定位至‘循环点’4.start-with()可以获取多个类似标签的内容3. string(.)方法可用于标签套标签的情况\对正则表达式 ,BeautifulSoup...

2019-06-09 18:21:17 80

原创 爬虫学习

5.17学习正则表达式爬取斗破苍穹小说主要代码如下headers = {'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36'}f = open('C:\\Users\\456\\Des...

2019-06-09 18:20:14 170

空空如也

空空如也

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

TA关注的人

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