johschmidt42 / PyTorch-Object-Detection-Faster-RCNN-Tutorial

76 stars 34 forks source link

ValueError: Your backbone_name is resnet34, but should be one of the following:['RESNET18', 'RESNET34', 'RESNET50', 'RESNET101', 'RESNET152'] #9

Closed JusSil501 closed 2 years ago

JusSil501 commented 2 years ago

image Im using the same param "resnet34" as stated on tutorial. I also tried 'RESNET34', but that didint work. image

johschmidt42 commented 2 years ago

@JusSil501 I've changed the way how the params are defined in this repo but didn't find the time to update the blog.

Take a look at the training script: training_script.py

...
# hyper-parameters
@dataclass
class Params:
    BATCH_SIZE: int = 2
    OWNER: str = "johschmidt42"  # set your name here, e.g. johndoe22
    SAVE_DIR: Optional[
        str
    ] = None  # checkpoints will be saved to cwd (current working directory)
    LOG_MODEL: bool = False  # whether to log the model to neptune after training
    GPU: Optional[int] = None  # set to None for cpu training
    LR: float = 0.001
    PRECISION: int = 32
    CLASSES: int = 2
    SEED: int = 42
    PROJECT: str = "Heads"
    EXPERIMENT: str = "heads"
    MAXEPOCHS: int = 500
    PATIENCE: int = 50
    BACKBONE: ResNetBackbones = ResNetBackbones.RESNET34
    FPN: bool = False
    ANCHOR_SIZE: Tuple[Tuple[int, ...], ...] = ((32, 64, 128, 256, 512),)
    ASPECT_RATIOS: Tuple[Tuple[float, ...]] = ((0.5, 1.0, 2.0),)
    MIN_SIZE: int = 1024
    MAX_SIZE: int = 1025
    IMG_MEAN: List = field(default_factory=lambda: [0.485, 0.456, 0.406])
    IMG_STD: List = field(default_factory=lambda: [0.229, 0.224, 0.225])
    IOU_THRESHOLD: float = 0.5

Here are some examples in the tests section.

JusSil501 commented 2 years ago

It worked thanks!