Skip to content
This repository was archived by the owner on Aug 30, 2018. It is now read-only.
This repository was archived by the owner on Aug 30, 2018. It is now read-only.

'ModelProto' object has no attribute 'opset_import' #98

@tjingrant

Description

@tjingrant

Hi,

I'm seeing the following error when loading official onnx models:

Traceback (most recent call last):
  File "test_model_large_stepping.py", line 37, in test
    cf_rep = c2.prepare(_model)
  File "/Users/xxx/onnx-caffe2/onnx_caffe2/backend.py", line 559, in prepare
    for imp in model.opset_import:
AttributeError: 'ModelProto' object has no attribute 'opset_import'

I'm using latest onnx from source, latest onnx-caffe2 from pip install.

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

import unittest
import numpy as np
import onnx
import onnx_caffe2.backend as c2
from onnx import helper
from onnx.onnx_pb2 import TensorProto

class TestLargeModel(unittest.TestCase):
  MODEL_PATH = "../../../onnx_models/"

  def test(self):
    _model = onnx.load(self.MODEL_PATH + "shufflenet/model.pb")
    cf_rep = c2.prepare(_model)

if __name__ == '__main__':
  unittest.main()

maybe time to update model zoo?

Best wishes,
Tian Jin.

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