question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

can't read inference model

See original GitHub issue

Hi there,

I’m trying to load the inference model which I created on my own data, but I got the error.

environment keras 2.2.4 tensorflow 1.12.0

I carried out the following

training

keras_retinanet/bin/train.py --weights snapshots/resnet50_coco_best_v2.1.0.h5 --freeze-backbone csv
annotation.csv classes.csv

I got the resnet50_csv_01.h5 model and so on.

Converting a training model to the inference model with 2 patterns.

1 follow the examples/ ResNet50RetinaNet.jpnb

Converting a training model to inference model on jupyter notebook

model_path = os.path.join('..', 'snapshots', 'resnet50_csv_20.h5')
model = models.load_model(model_path, backbone_name='resnet50')
model = models.convert_model(model)

I got this error

AttributeError: module `keras_retinanet.models` has no attribute 'convert_model'

2 Converting a training model to inference model on this code

keras_retinanet/bin/convert_model.py /snapshots/resnet50_csv_01.h5 /snapshots/resnet50_csv_01_inference.h5

then

model_path = os.path.join('..', 'snapshots', 'resnet50_csv_01_inference.h5')
model = models.load_model(model_path, backbone_name='resnet50')

I got this error

/usr/local/lib/python3.5/dist-packages/keras/engine/base_layer.py in __init__(self, **kwargs)
126 for kwarg in kwargs:
127 if kwarg not in allowed_kwargs:
--> 128 raise TypeError('Keyword argument not understood:', kwarg)
129 name = kwargs.get('name')
130 if not name:

TypeError: ('Keyword argument not understood:', 'class_specific_filter')

Could you give me some advice?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
gs55commented, Nov 26, 2018

I solved this problem!! thank you for your advice.

0reactions
theainerdcommented, Dec 24, 2018

@gs55 I am facing the same problem. Any idea how to resolve it?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Inference | Classroom Strategies - Reading Rockets
In this model, teachers pose four questions to students to facilitate a discussion about inferences (Marzano, 2010). The goal is for students to...
Read more >
webpack - failed to inference ONNX model: TypeError
I get this error: failed to inference ONNX model: TypeError: Cannot read properties of undefined (reading 'InferenceSession'). Other info: " ...
Read more >
Resolved - Can't load trained model for inference - Unity Forum
Go to load any one of the 10 .onnx files into the behavior parameters, drag and drop the file in like usual. Immediate...
Read more >
How to Teach Making Inferences in Upper Elementary
This is because you are teaching students to identify something they can't explicitly find in this text. It requires some critical thinking skills....
Read more >
Making Inferences: 6 Essential Strategies
How do you help students make inferences while reading? ... When reading aloud or during a discussion, model the process of inferential ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found