OlafenwaMoses / ImageAI

A python library built to empower developers to build applications and systems with self-contained Computer Vision capabilities
https://www.genxr.co/#products
MIT License
8.48k stars 2.18k forks source link

Training with GPU #784

Open ARatcliffe101 opened 1 year ago

ARatcliffe101 commented 1 year ago

Hello,

I have all the gpu packages and no cpu ones yet It wont train via gpu usign the default code:

from imageai.Classification.Custom import ClassificationModelTrainer model_trainer = ClassificationModelTrainer() model_trainer.setModelTypeAsResNet50() model_trainer.setDataDirectory("idenprof") model_trainer.trainModel(num_experiments=100, batch_size=32)

OlafenwaMoses commented 1 year ago

@ARatcliffe101

import torch
print(torch.cuda.is_available())
SupercraftD commented 1 year ago

Hi, I'm not the original poster but I am also having a similar problem. I am trying to train an image recognition AI but it will not use the GPU. the code snippet you provided evaluated to false, so I think that is the problem. However, I have tried to install cuda before, and it failed on the "Nsight Visual Studio Edition". I tried again and only selected the cuda files in the nvidia cuda installer. That showed it successfully installed, but it still won't work. I don't think it is very clear, so how exactly do I install cuda?