roofAI πŸ›οΈ on GPU β€” 2

Arash Kamangir
3 min readNov 27, 2023

--

Next, in roofAI πŸ›οΈ, boot up SageMaker with GPU,

from https://aws.amazon.com/sagemaker/pricing/

@seed sagemaker plugin=roofAI,screen

on Mac,

βš™οΈ python3 -m roofAI.semseg predict β€” device cpu β€” model_path /Users/kamangir/storage/abcli/2023–10–29–12–57–16–38247 β€” dataset_path /Users/kamangir/storage/abcli/roofAI_ingest_AIRS_2023–11–12–19–44–22–27771 β€” prediction_path /Users/kamangir/storage/abcli/2023–11–26–19–22–40–31128 β€” profile FULL

+= tqdm.

why doesn’t vscode click not work? fixed, thanks to OpenAI.

report prediction time.

took 390 millisecond(s)

roofAI semseg predict \
profile=VALIDATION \
$(@ref roofAI_semseg_model_AIRS_full_v2) \
$(@ref roofAI_ingest_AIRS_v2) \
$(@timestamp)
roofAI semseg predict \
device=cpu,profile=VALIDATION \
$(@ref roofAI_semseg_model_AIRS_full_v2) \
$(@ref roofAI_ingest_AIRS_v2) \
$(@timestamp)

took 333 millisecond(s)

validate a roofAI predict on GPU,

roofAI semseg predict \
device=cuda,profile=VALIDATION \
$(@ref roofAI_semseg_model_AIRS_full_v2) \
$(@ref roofAI_ingest_AIRS_v2) \
$(@timestamp)
pr_mask = self.model.predict(x_tensor)

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

using https://stackoverflow.com/questions/59013109/runtimeerror-input-type-torch-floattensor-and-weight-type-torch-cuda-floatte

took 235 millisecond(s)

roofAI semseg predict \
device=cpu,profile=QUICK \
$(@ref roofAI_semseg_model_AIRS_full_v2) \
$(@ref roofAI_ingest_AIRS_v2) \
$(@timestamp)
roofAI semseg predict \
device=cuda,profile=QUICK \
$(@ref roofAI_semseg_model_AIRS_full_v2) \
$(@ref roofAI_ingest_AIRS_v2) \
$(@timestamp)

10+ times faster. πŸš€

duplicate item in the roofAI signature, investigate βœ… document elapsed time βœ… number of objects on the image βœ…

roofAI semseg predict \
device=cpu,profile=VALIDATION \
$(@ref roofAI_semseg_model_AIRS_full_v2) \
$(@ref roofAI_ingest_AIRS_v2) \
$(@timestamp)
roofAI semseg predict \
profile=VALIDATION \
$(@ref roofAI_semseg_model_AIRS_full_v2) \
$(@ref roofAI_ingest_AIRS_v2) \
$(@timestamp)
roofAI semseg predict \
profile=QUICK \
$(@ref roofAI_semseg_model_AIRS_full_v2) \
$(@ref roofAI_ingest_AIRS_v2) \
$(@timestamp)

validate train on CPU βœ… on GPU βœ…

roofAI semseg train \
profile=VALIDATION \
$(@ref roofAI_ingest_AIRS_v2) \
$(@timestamp) \
--classes roof

RuntimeError: Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the same or input should be a MKLDNN tensor and weight is a dense tensor

pr_mask = self.model.predict(x_tensor)
roofAI semseg train \
profile=QUICK,upload \
$(@ref roofAI_ingest_AIRS_v2) \
$(@timestamp) \
--classes roof

Next: training on GPU.

--

--

No responses yet