Skip to content
The Chat Archive
o1-mini-2024-09-12· OpenAI WildChat-4.8M (AI2)

the model integration of using NAS, OPTUNA, FBN, FAN, SwinTransformer with CenterNetUnet…

  1. User

    the model integration of using NAS, OPTUNA, FBN, FAN, SwinTransformer with CenterNetUnet needs to be reviewed deeply here in both files centernet_unet.py and multilabel_circle_net.yaml @centernet_unet.py @multilabel_circle_net.yaml

    here are both deeply as you are a super advanced machine learning software engineer please help to solve errors and creatively enhance, and ensure deep entergation of these models in that project of the current codebase which able to detect vessels and decide if fishing or not using TIFF SAR images @Codebase

    if you understand my model say 'done' so I can start show you the files after just reading the error

    ##the error DEBUG:rasterio._env:GDAL_DATA found in environment. DEBUG:rasterio._env:PROJ_DATA found in environment. DEBUG:rasterio._env:Started GDALEnv: self=<rasterio._env.GDALEnv object at 0x3359740d0>. DEBUG:rasterio.env:Entered env context: <rasterio.env.Env object at 0x3359740a0> DEBUG:rasterio._base:Sharing flag: 0 DEBUG:rasterio._base:Nodata success: 1, Nodata value: -32768.000000 DEBUG:rasterio._base:Dataset is started. DEBUG:rasterio.env:Exiting env context: <rasterio.env.Env object at 0x3359740a0> DEBUG:rasterio.env:Cleared existing <rasterio._env.GDALEnv object at 0x3359740d0> options DEBUG:rasterio._env:Stopped GDALEnv <rasterio._env.GDALEnv object at 0x3359740d0>. DEBUG:rasterio.env:Exiting outermost env DEBUG:rasterio.env:Exited env context: <rasterio.env.Env object at 0x3359740a0> DEBUG:rasterio.env:Entering env context: <rasterio.env.Env object at 0x331e4b7c0> DEBUG:rasterio.env:Starting outermost env DEBUG:rasterio.env:No GDAL environment exists DEBUG:rasterio.env:New GDAL environment <rasterio._env.GDALEnv object at 0x3359740d0> created DEBUG:rasterio._env:GDAL_DATA found in environment. DEBUG:rasterio._env:PROJ_DATA found in environment. DEBUG:rasterio._env:Started GDALEnv: self=<rasterio._env.GDALEnv object at 0x3359740d0>. DEBUG:rasterio.env:Entered env context: <rasterio.env.Env object at 0x331e4b7c0> DEBUG:rasterio._io:Output nodata value read from file: -32768.0 DEBUG:rasterio._io:Output nodata values: [-32768.0] DEBUG:rasterio._io:all_valid: False DEBUG:rasterio._io:mask_flags: ([<MaskFlags.nodata: 8>],) DEBUG:rasterio._io:Jump straight to _read() DEBUG:rasterio._io:Window: Window(col_off=21276, row_off=5900, width=512, height=512) DEBUG:rasterio._io:IO window xoff=21276.0 yoff=5900.0 width=512.0 height=512.0 DEBUG:rasterio.env:Exiting env context: <rasterio.env.Env object at 0x3377b4c70> DEBUG:rasterio.env:Cleared existing <rasterio._env.GDALEnv object at 0x3377b4b50> options DEBUG:rasterio._env:Stopped GDALEnv <rasterio._env.GDALEnv object at 0x3377b4b50>. DEBUG:rasterio.env:Exiting outermost env DEBUG:rasterio.env:Exited env context: <rasterio.env.Env object at 0x3377b4c70> [DEBUG] Channel 0 shape: (512, 512) [DEBUG] Channel 1 shape: (512, 512) (256.0, 268.0, 0.0) [<class 'float'>, <class 'float'>, <class 'float'>] DEBUG:rasterio.env:Exiting env context: <rasterio.env.Env object at 0x331e4b7c0> DEBUG:rasterio.env:Cleared existing <rasterio._env.GDALEnv object at 0x3359740d0> options DEBUG:rasterio._env:Stopped GDALEnv <rasterio._env.GDALEnv object at 0x3359740d0>. DEBUG:rasterio.env:Exiting outermost env DEBUG:rasterio.env:Exited env context: <rasterio.env.Env object at 0x331e4b7c0> [DEBUG] Channel 0 shape: (512, 512) [DEBUG] Channel 1 shape: (512, 512) (297.0, 256.0, 2.499000072479248) [<class 'float'>, <class 'float'>, <class 'float'>] Available keys in model config: dict_keys(['target', 'slug', 'weights', 'pretrained', 'output_stride', 'image_size', 'window_size', 'transformer', 'decoder', 'encoder', 'nas', 'num_channels', 'num_classes', 'anchors', 'input_upsample_factor', 'neck_out_channels', 'box_coder', 'head', 'config']) Complete model configuration: target: xview3.centernet.models.CenterNetUNetModel.from_config slug: b5_unet_s2 weights: IMAGENET1K_V1 pretrained: true output_stride: 32 image_size:

    • 1024
    • 1024 window_size:
    • 4
    • 4 transformer: enabled: true embed_dim: 96 depths:
      • 2
      • 2
      • 6
      • 2 num_heads:
      • 3
      • 6
      • 12
      • 24 window_size:
      • 4
      • 4 mlp_ratio: 4.0 qkv_bias: true qk_scale: null drop_rate: 0.0 attn_drop_rate: 0.0 drop_path_rate: 0.1 norm_layer: null use_dropout: false use_custom_pos_embed: false decoder: target: xview3.centernet.models.custom_encoder.DebugUNetDecoder encoder_channels:
      • 32
      • 24
      • 40
      • 112
      • 320 channels:
      • 512
      • 384
      • 256
      • 128
      • 64 unet_block: target: xview3.centernet.models.unet_blocks.UnetBlock partial: true upsample_block: target: torch.nn.Upsample scale_factor: 2 mode: bilinear encoder: target: pytorch_toolbelt.modules.encoders.TimmEfficientNetV2 model_name: efficientnetv2_rw_s pretrained: true activation: silu drop_rate: 0.1 drop_path_rate: 0.1 layers:
      • 1
      • 2
      • 3
      • 4 nas: enabled: true search_space: num_layers:
        • 2
        • 5 num_filters:
        • 64
        • 128
        • 256 kernel_size:
        • 3
        • 5 activation:
        • relu
        • leaky_relu dropout_rate_max: 0.5 num_trials: 50 num_channels: 2 num_classes: 2 anchors:
      • 10
      • 13
      • 16
      • 30
      • 33
      • 23 input_upsample_factor: 1 neck_out_channels: 256 box_coder: target: xview3.centernet.bboxer.multilabel_circle_coder.MultilabelCircleNetCoder image_size:
      • 1024
      • 1024 max_objects: 512 heatmap_encoding: umich labels_encoding: circle ignore_value: target: xview3.ignore_value fixed_radius: 3 labels_radius: 1 ignore_low_confidence_detections: ${dataset.ignore_low_confidence_detections} head: decoupled_head: target: xview3.centernet.models.heads.DecoupledHeadGroupNormLateShuffle channels: 256 classifier_dim: 128 objectness_dim: 128 size_dim: 128 offset_dim: 16 dropout_rate: 0.1 activation: silu num_blocks: 3 yolo_head: target: xview3.centernet.models.heads.yolo_head.YOLOHead num_classes: 2 anchors:
          • 10
          • 13
          • 16
          • 30
          • 33
          • 23 input_image_size:
        • 640
        • 640 stride: 32 config: slug: b5_unet_s2 activation: silu num_channels: ${dataset.num_channels} num_extra_blocks: 0 encoder: target: pytorch_toolbelt.modules.encoders.TimmB5Encoder pretrained: true activation: silu layers:
        • 1
        • 2
        • 3
        • 4 decoder: upsample_type: shuffle block_type: IRBlock channels:
        • 256
        • 384
        • 512 head: target: xview3.centernet.models.heads.DecoupledHeadGroupNormLateShuffle classifier_dim: 128 objectness_dim: 128 size_dim: 64 offset_dim: 16 dropout_rate: 0.1 activation: silu num_groups: 4 num_blocks: 3 box_coder: target: xview3.centernet.MultilabelCircleNetCoder image_size:
        • 1024
        • 1024 max_objects: 512 heatmap_encoding: umich labels_encoding: circle ignore_value: target: xview3.ignore_value fixed_radius: 3 labels_radius: 1 ignore_low_confidence_detections: ${dataset.ignore_low_confidence_detections}

    [DEBUG] Number of heads instantiated: 2 [DEBUG] Head 0 type: <class 'xview3.centernet.models.heads.decoupled_head.DecoupledHeadGroupNormLateShuffle'> [DEBUG] Head 1 type: <class 'xview3.centernet.models.heads.yolo_head.YOLOHead'> [2024-10-05 12:54:09,358][timm.models._builder][INFO] - Loading pretrained weights from Hugging Face hub (timm/efficientnetv2_rw_s.ra2_in1k) [2024-10-05 12:54:09,528][timm.models._hub][INFO] - [timm/efficientnetv2_rw_s.ra2_in1k] Safe alternative available for 'pytorch_model.bin' (as 'model.safetensors'). Loading weights using safetensors. [2024-10-05 12:54:09,566][timm.models._builder][WARNING] - Unexpected keys (bn2.bias, bn2.num_batches_tracked, bn2.running_mean, bn2.running_var, bn2.weight, classifier.bias, classifier.weight, conv_head.weight) found while loading pretrained weights. This may be expected if model is being adapted. [2024-10-05 12:54:09,813][timm.models._builder][INFO] - Loading pretrained weights from Hugging Face hub (timm/efficientnetv2_rw_s.ra2_in1k) [2024-10-05 12:54:09,951][timm.models._hub][INFO] - [timm/efficientnetv2_rw_s.ra2_in1k] Safe alternative available for 'pytorch_model.bin' (as 'model.safetensors'). Loading weights using safetensors. [2024-10-05 12:54:09,972][timm.models._builder][INFO] - Converted input conv conv_stem pretrained weights from 3 to 2 channel(s) [2024-10-05 12:54:09,986][timm.models._builder][WARNING] - Unexpected keys (bn2.bias, bn2.num_batches_tracked, bn2.running_mean, bn2.running_var, bn2.weight, classifier.bias, classifier.weight, conv_head.weight) found while loading pretrained weights. This may be expected if model is being adapted. Error executing job with overrides: [] Traceback (most recent call last): File "/Volumes/Crucial/SAR-MPS-OptunaNasFbnYoloTransformers/train_multilabel3.py", line 806, in main() File "/opt/anaconda3/envs/sam3/lib/python3.9/site-packages/hydra/main.py", line 94, in decorated_main _run_hydra( File "/opt/anaconda3/envs/sam3/lib/python3.9/site-packages/hydra/_internal/utils.py", line 394, in _run_hydra _run_app( File "/opt/anaconda3/envs/sam3/lib/python3.9/site-packages/hydra/_internal/utils.py", line 457, in _run_app run_and_report( File "/opt/anaconda3/envs/sam3/lib/python3.9/site-packages/hydra/_internal/utils.py", line 223, in run_and_report raise ex File "/opt/anaconda3/envs/sam3/lib/python3.9/site-packages/hydra/_internal/utils.py", line 220, in run_and_report return func() File "/opt/anaconda3/envs/sam3/lib/python3.9/site-packages/hydra/_internal/utils.py", line 458, in lambda: hydra.run( File "/opt/anaconda3/envs/sam3/lib/python3.9/site-packages/hydra/_internal/hydra.py", line 132, in run _ = ret.return_value File "/opt/anaconda3/envs/sam3/lib/python3.9/site-packages/hydra/core/utils.py", line 260, in return_value raise self._return_value File "/opt/anaconda3/envs/sam3/lib/python3.9/site-packages/hydra/core/utils.py", line 186, in run_job ret.return_value = task_function(task_cfg) File "/Volumes/Crucial/SAR-MPS-OptunaNasFbnYoloTransformers/train_multilabel3.py", line 802, in main pipeline.train() File "/Volumes/Crucial/SAR-MPS-OptunaNasFbnYoloTransformers/train_multilabel3.py", line 520, in train self.model = self.build_model(config, train_loader) File "/Volumes/Crucial/SAR-MPS-OptunaNasFbnYoloTransformers/train_multilabel3.py", line 331, in build_model self.model = CenterNetUNetModel.from_config(config.model) File "/Volumes/Crucial/SAR-MPS-OptunaNasFbnYoloTransformers/xview3/centernet/models/centernet_unet.py", line 566, in from_config encoder_module = CustomTimmEncoder( File "/Volumes/Crucial/SAR-MPS-OptunaNasFbnYoloTransformers/xview3/centernet/models/custom_encoder.py", line 139, in init self.conv_stem = self.patch_embed.proj File "/opt/anaconda3/envs/sam3/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1729, in getattr raise AttributeError(f"'{type(self).name}' object has no attribute '{name}'") AttributeError: 'CustomTimmEncoder' object has no attribute 'patch_embed' (sam3) samerkharboush@Samers-MBP SAR-MPS-Optun

  2. Assistant

    Done