(segmentation) PS H:\workspaces\segmentation_api> python main.py --image tests/images/cat_3.jpg
preprocessor_config.json: 100%|███████████████████████████████████████████████████████████████| 406/406 [00:00<?, ?B/s]
C:\Users\junyu\anaconda3\envs\segmentation\lib\site-packages\huggingface_hub\file_download.py:143: UserWarning: `huggingface_hub` cache-system uses symlinks by default to efficiently store duplicated files but your machine does not support them in C:\Users\junyu\.cache\huggingface\hub\models--google--deeplabv3_mobilenet_v2_1.0_513. Caching files will still work but in a degraded version that might require more space on your disk. This warning can be disabled by setting the `HF_HUB_DISABLE_SYMLINKS_WARNING` environment variable. For more details, see https://huggingface.co/docs/huggingface_hub/how-to-cache#limitations.
To support symlinks on Windows, you either need to activate Developer Mode or to run Python as an administrator. In order to activate developer mode, see this article: https://docs.microsoft.com/en-us/windows/apps/get-started/enable-your-device-for-development
  warnings.warn(message)
Using a slow image processor as `use_fast` is unset and a slow processor was saved with this model. `use_fast=True` will be the default behavior in v4.52, even if the model was saved with a slow processor. This will result in minor differences in outputs. You'll still be able to use a slow processor with `use_fast=False`.
config.json: 1.38kB [00:00, ?B/s]
pytorch_model.bin: 100%|██████████████████████████████████████████████████████████| 10.4M/10.4M [00:00<00:00, 15.8MB/s]
2025-10-22 14:25:33,617 - models.huggingface_sementic_segmentation_model - INFO - Loading google/deeplabv3_mobilenet_v2_1.0_513 ...
2025-10-22 14:25:33,810 - models.huggingface_sementic_segmentation_model - INFO -  google/deeplabv3_mobilenet_v2_1.0_513 model loaded successfully!
2025-10-22 14:25:33,810 - __main__ - INFO - Processing tests/images/cat_3.jpg
2025-10-22 14:25:33,810 - utils.utils - INFO - Loading image from tests/images/cat_3.jpg
2025-10-22 14:25:33,975 - inference.segmenter - ERROR - Segmentation failed for tests/images/cat_3.jpg: 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
Traceback (most recent call last):
  File "H:\workspaces\segmentation_api\main.py", line 58, in <module>
    main()
  File "H:\workspaces\segmentation_api\main.py", line 52, in main
    results = segmenter.segment(args.image, target_class_ids=args.target_ids, threshold=args.threshold)
  File "H:\workspaces\segmentation_api\inference\segmenter.py", line 50, in segment
    results = self.model.predict(image, target_class_ids, threshold)
  File "H:\workspaces\segmentation_api\models\huggingface_sementic_segmentation_model.py", line 61, in predict
    outputs = self.model(**inputs)
  File "C:\Users\junyu\anaconda3\envs\segmentation\lib\site-packages\torch\nn\modules\module.py", line 1775, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "C:\Users\junyu\anaconda3\envs\segmentation\lib\site-packages\torch\nn\modules\module.py", line 1786, in _call_impl
    return forward_call(*args, **kwargs)
  File "C:\Users\junyu\anaconda3\envs\segmentation\lib\site-packages\transformers\models\mobilenet_v2\modeling_mobilenet_v2.py", line 746, in forward
    outputs = self.mobilenet_v2(
  File "C:\Users\junyu\anaconda3\envs\segmentation\lib\site-packages\torch\nn\modules\module.py", line 1775, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "C:\Users\junyu\anaconda3\envs\segmentation\lib\site-packages\torch\nn\modules\module.py", line 1786, in _call_impl
    return forward_call(*args, **kwargs)
  File "C:\Users\junyu\anaconda3\envs\segmentation\lib\site-packages\transformers\models\mobilenet_v2\modeling_mobilenet_v2.py", line 527, in forward
    hidden_states = self.conv_stem(pixel_values)
  File "C:\Users\junyu\anaconda3\envs\segmentation\lib\site-packages\torch\nn\modules\module.py", line 1775, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "C:\Users\junyu\anaconda3\envs\segmentation\lib\site-packages\torch\nn\modules\module.py", line 1786, in _call_impl
    return forward_call(*args, **kwargs)
  File "C:\Users\junyu\anaconda3\envs\segmentation\lib\site-packages\transformers\models\mobilenet_v2\modeling_mobilenet_v2.py", line 415, in forward
    features = self.first_conv(features)
  File "C:\Users\junyu\anaconda3\envs\segmentation\lib\site-packages\torch\nn\modules\module.py", line 1775, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "C:\Users\junyu\anaconda3\envs\segmentation\lib\site-packages\torch\nn\modules\module.py", line 1786, in _call_impl
    return forward_call(*args, **kwargs)
  File "C:\Users\junyu\anaconda3\envs\segmentation\lib\site-packages\transformers\models\mobilenet_v2\modeling_mobilenet_v2.py", line 321, in forward
    features = self.convolution(features)
  File "C:\Users\junyu\anaconda3\envs\segmentation\lib\site-packages\torch\nn\modules\module.py", line 1775, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "C:\Users\junyu\anaconda3\envs\segmentation\lib\site-packages\torch\nn\modules\module.py", line 1786, in _call_impl
    return forward_call(*args, **kwargs)
  File "C:\Users\junyu\anaconda3\envs\segmentation\lib\site-packages\torch\nn\modules\conv.py", line 548, in forward
    return self._conv_forward(input, self.weight, self.bias)
  File "C:\Users\junyu\anaconda3\envs\segmentation\lib\site-packages\torch\nn\modules\conv.py", line 543, in _conv_forward
    return F.conv2d(
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
model.safetensors: 100%|██████████████████████████████████████████████████████████| 10.3M/10.3M [00:00<00:00, 36.9MB/s]