smtnkc / pytorch-animals Goto Github PK
View Code? Open in Web Editor NEWMulti-label image classification with transfer learning
License: MIT License
Multi-label image classification with transfer learning
License: MIT License
(animal) C:\Users\ADMIN\Desktop\AI\pytorch-animals>python main.py --device cuda --epochs 100
NVIDIA GeForce RTX 3060 Laptop GPU
Created json args file -> dumps\pt_20221129_215959\args.json
Python Version: 3.7.15
PyTorch Version: 1.13.0+cu116
Torchvision Version: 0.14.0+cu116
GPU :
True
C:\Users\ADMIN.conda\envs\animal\lib\site-packages\torchvision\models_utils.py:209: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and may be removed in the future, please use 'weights' instead.
f"The parameter '{pretrained_param}' is deprecated since 0.13 and may be removed in the future, "
C:\Users\ADMIN.conda\envs\animal\lib\site-packages\torchvision\models_utils.py:223: UserWarning: Arguments other than a weight enum or None
for 'weights' are deprecated since 0.13 and may be removed in the future. The current behavior is equivalent to passing weights=AlexNet_Weights.IMAGENET1K_V1
. You can also use weights=AlexNet_Weights.DEFAULT
to get the most up-to-date weights.
warnings.warn(msg)
ARCHITECTURE:
AlexNet(
(features): Sequential(
(0): Conv2d(3, 64, kernel_size=(11, 11), stride=(4, 4), padding=(2, 2))
(1): ReLU(inplace=True)
(2): MaxPool2d(kernel_size=3, stride=2, padding=0, dilation=1, ceil_mode=False)
(3): Conv2d(64, 192, kernel_size=(5, 5), stride=(1, 1), padding=(2, 2))
(4): ReLU(inplace=True)
(5): MaxPool2d(kernel_size=3, stride=2, padding=0, dilation=1, ceil_mode=False)
(6): Conv2d(192, 384, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
(7): ReLU(inplace=True)
(8): Conv2d(384, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
(9): ReLU(inplace=True)
(10): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
(11): ReLU(inplace=True)
(12): MaxPool2d(kernel_size=3, stride=2, padding=0, dilation=1, ceil_mode=False)
)
(avgpool): AdaptiveAvgPool2d(output_size=(6, 6))
(classifier): Sequential(
(0): Dropout(p=0.5, inplace=False)
(1): Linear(in_features=9216, out_features=4096, bias=True)
(2): ReLU(inplace=True)
(3): Dropout(p=0.5, inplace=False)
(4): Linear(in_features=4096, out_features=4096, bias=True)
(5): ReLU(inplace=True)
(6): Linear(in_features=4096, out_features=5, bias=True)
)
)
features.0.weight requires_grad = False
features.0.bias requires_grad = False
features.3.weight requires_grad = False
features.3.bias requires_grad = False
features.6.weight requires_grad = False
features.6.bias requires_grad = False
features.8.weight requires_grad = False
features.8.bias requires_grad = False
features.10.weight requires_grad = False
features.10.bias requires_grad = False
classifier.1.weight requires_grad = False
classifier.1.bias requires_grad = False
classifier.4.weight requires_grad = False
classifier.4.bias requires_grad = False
classifier.6.weight requires_grad = True
classifier.6.bias requires_grad = True
RUNNING ARGS:
{
"seed": 2020,
"batch_size": 14,
"epochs": 100,
"lr": 0.001,
"weight_decay": 0.0,
"optimizer": "sgdm",
"input_size": 224,
"display_images": false,
"pretrained": true,
"save": true,
"device": "cuda",
"t_start": "20221129_215959"
}
Created stats file -> dumps\pt_20221129_215959\stats.csv
TRAINING 100 EPOCHS...
Traceback (most recent call last):
File "main.py", line 70, in
main()
File "main.py", line 59, in main
model, optimizer = train_model(model, data_loaders, criterion, optimizer, args)
File "C:\Users\ADMIN\Desktop\AI\pytorch-animals\model_helper.py", line 105, in train_model
phase_preds = torch.cat((phase_preds, preds), 0)
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cpu and cuda:0! (when checking argument for argument tensors in method wrapper_cat)
Try fix data_loader.py but is an error similar :
# Create training, validation and test dataloaders
# When using CUDA, set num_workers=1 and pin_memory=True
data_loaders = {x: DL(img_folders[x], batch_size=args.batch_size, shuffle=True,
num_workers=1,
pin_memory=True)
for x in cfg.PHASES}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.