Giter VIP home page Giter VIP logo

pytorch-animals's People

Contributors

smtnkc avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

nson28

pytorch-animals's Issues

Traning with cuda error

(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}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.