Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

segmentation tutorial fix #1228

Merged
merged 3 commits into from
Sep 24, 2024
Merged

Conversation

samuel-wj-chapman
Copy link
Contributor

@samuel-wj-chapman samuel-wj-chapman commented Sep 23, 2024

Pull Request Description:

tutorial fails when running with google golab gpu. fix supports use of gpu.

Checklist before requesting a review:

  • I set the appropriate labels on the pull request.
  • I have added/updated the release note draft (if necessary).
  • I have updated the documentation to reflect my changes (if necessary).
  • All function and files are well documented.
  • All function and classes have type hints.
  • There is a licenses in all file.
  • The function and variable names are informative.
  • I have checked for code duplications.
  • I have added new unittest (if necessary).

@@ -428,6 +428,8 @@
"source": [
"from tutorials.mct_model_garden.models_pytorch.yolov8.yolov8 import seg_model_predict\n",
"from tutorials.mct_model_garden.evaluation_metrics.coco_evaluation import evaluate_yolov8_segmentation\n",
"device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')\n",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use the following code, to align with other tutorials (see pytorch_yolov8n_for_imx500.ipynb):

Get working device

device = get_working_device()

@@ -536,11 +536,12 @@ def seg_model_predict(model: Any,
List: List containing tensors of predictions.
"""
input_tensor = torch.from_numpy(inputs).unsqueeze(0) # Add batch dimension

device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please change to: device = get_working_device()

@samuel-wj-chapman samuel-wj-chapman merged commit c90c5f2 into sony:main Sep 24, 2024
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants