Skip to content

copy.deepcopy does not work on Faster R-CNN models #1

@joskaaaa

Description

@joskaaaa

Relying on copy.deepcopy to copy the model in:

  • compression_conf_fc.ipynb
  • compress.py

Does not work for Faster R-CNN models which use mixed serialization & non-script modules.

This results in the error: _pickle.PickleError: ScriptModules cannot be saved using torch.save. Mixed serialization of script and non-script modules is not supported. For purely script modules use my_script_module.save(<filename>) instead.

Refer to PyTorch issue 18106.

What Faster R-CNN Resnet50 model were you using for this to work? I have been trying with the torchvision pretrained model with no success: torchvision.models.detection.fasterrcnn_resnet50_fpn(pretrained=True)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions