Error when running UnetClassifier model

537
1
12-09-2022 03:02 AM
StanNoordman
New Contributor

I tried running a UnetClassifier model but i keep getting an error when trying to find the optimal learning rate. The error is as follows: 

RuntimeError: Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the same

Now i found out that this means that the model is running on the gpu and my data is on the cpu. I used the prepare data function to create my data, and i can't find a option to get my data to prepare on GPU instead of CPU. 

I am running my code in a notebook in arcgis pro version 3.0.2, the dataset i'm using is land_cover_classification_using_sparse_training_data  and i'm running the code below

 

data = prepare_data(path=output_path, batch_size=6, imagery_type='naip', dataset_type='Classified_Tiles')

model = UnetClassifier(data, backbone='resnet34', ignore_classes=[0])

lr = model.lr_find()

 

0 Kudos
1 Reply
StanNoordman
New Contributor

Does anyone have a solution for this problem?

0 Kudos