Create an efficientnet model according to name. Args: model_name (str): Name for efficientnet. in_channels (int): Input data's channel number. override_params (other key word params): Params to override model's global_params.
(cls, model_name, in_channels=3, **override_params)
| 608 | |
| 609 | @classmethod |
| 610 | def from_name(cls, model_name, in_channels=3, **override_params): |
| 611 | """Create an efficientnet model according to name. |
| 612 | Args: |
| 613 | model_name (str): Name for efficientnet. |
| 614 | in_channels (int): Input data's channel number. |
| 615 | override_params (other key word params): |
| 616 | Params to override model's global_params. |
| 617 | Optional key: |
| 618 | 'width_coefficient', 'depth_coefficient', |
| 619 | 'image_size', 'dropout_rate', |
| 620 | 'num_classes', 'batch_norm_momentum', |
| 621 | 'batch_norm_epsilon', 'drop_connect_rate', |
| 622 | 'depth_divisor', 'min_depth' |
| 623 | Returns: |
| 624 | An efficientnet model. |
| 625 | """ |
| 626 | cls._check_model_name_is_valid(model_name) |
| 627 | blocks_args, global_params = get_model_params(model_name, override_params) |
| 628 | model = cls(blocks_args, global_params) |
| 629 | model._change_in_channels(in_channels) |
| 630 | return model |
| 631 | |
| 632 | @classmethod |
| 633 | def from_pretrained(cls, model_name, weights_path=None, advprop=False, |
no test coverage detected