Skip to content

ValueError: 'onnx::Ma/' is not a valid root scope name. #147

@pranoyr

Description

@pranoyr

Describe the bug
I am running the below code snippet and getting this error.

ValueError: 'onnx::Ma/' is not a valid root scope name. A root scope name has to match the following pattern: ^[A-Za-z0-9.][A-Za-z0-9_.\/>-]*$

To Reproduce

import os
os.environ['CUDA_VISIBLE_DEVICES'] = ''
import sys
sys.path.insert(0, '../expression_capture/')
from torchvision import models
from models.resnet18 import Fc

import torch
from pytorch2keras.converter import pytorch_to_keras



model = models.resnet18(pretrained=True).eval()



x = torch.randn(1, 3, 224, 224, requires_grad=False)
k_model = pytorch_to_keras(model, x, [(3, None, None,)], verbose=True, name_policy='short')
k_model.save('keras.h5') 

Environment (please complete the following information):

  • OS: Ubuntu 22.04
  • Python 3
  • Version v3.10
  • onnx==1.12.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions