TexasInstruments / edgeai-benchmark

This repository has been moved. The new location is in https://github.com/TexasInstruments/edgeai-tensorlab
https://github.com/TexasInstruments/edgeai
Other
3 stars 0 forks source link

module 'jai_benchmark.constants' has no attribute 'SESSION_NAME_ONNXRTRT' #2

Closed min0628 closed 2 years ago

min0628 commented 2 years ago

Hi,

I found this error when tested the tutorials modified using the ONNX session. AttributeError: module 'jai_benchmark.constants' has no attribute 'SESSION_NAME_ONNXRTRT'

I checked the jal_benchmark module, and found SESSION_NAME_ONNXRT. It looks like typing error.

mathmanu commented 2 years ago

when tested the tutorials modified using the ONNX session.

What do you mean by this? Can you give more details? Which code did you run and what did you modify. Please give the stack trace of the error as well.

min0628 commented 2 years ago

I tested tutorials files that tutorials/tutorial_classification.ipynb, tutorials/tutorial_detection.ipynb with ONNX models.

I modified session_name to use ONNX model.

# choose one session_name depending on the model type
# tflitert for tflite models, onnxrt for onnx models, tvmdlr for mxnet models.
#session_name = constants.SESSION_NAME_TFLITERT
session_name = constants.SESSION_NAME_ONNXRTRT  #<- disable comment this line
#session_name = constants.SESSION_NAME_TVMDLR

session_type = settings.get_session_type(session_name)
runtime_options = settings.get_runtime_options(session_name, is_qat=False)

print(session_type)
print(runtime_options)

And error occur when this code running.

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-6-0ed9d4c82056> in <module>
      2 # tflitert for tflite models, onnxrt for onnx models, tvmdlr for mxnet models.
      3 #session_name = constants.SESSION_NAME_TFLITERT
----> 4 session_name = constants.SESSION_NAME_ONNXRTRT
      5 #session_name = constants.SESSION_NAME_TVMDLR
      6 

AttributeError: module 'jai_benchmark.constants' has no attribute 'SESSION_NAME_ONNXRTRT'

To resolve this error, i searched the jal_benchmark for SESSION_NAME and found jal_benchmark/constants.py file.

SESSION_NAME_TVMDLR = 'tvmdlr'
SESSION_NAME_TFLITERT = 'tflitert'
SESSION_NAME_ONNXRT = 'onnxrt'

SESSION_NAME_ONNXRTRT is not defined, SESSION_NAME_ONNXRT is defined. So I think there is an typing error in the SESSION_NAME of the tutorial file.

mathmanu commented 2 years ago

You are right. That is a typing error. Thanks for reporting it. It is now fixed.