Instructions to use amd/resnet50 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use amd/resnet50 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="amd/resnet50") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# Load model directly from transformers import AutoImageProcessor, AutoModelForImageClassification processor = AutoImageProcessor.from_pretrained("amd/resnet50") model = AutoModelForImageClassification.from_pretrained("amd/resnet50") - Notebooks
- Google Colab
- Kaggle
ONNXRuntimeError when changing batch size value.
When I use --batch_size argument, I will meet ONNXRuntimeError if batch size is not 1. Error message:
"File "anaconda3\envs\ryzenai-1.1-20240306-114619\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 217, in run
return self._sess.run(output_names, input_feed, run_options)
onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Non-zero status code returned while running vitis_ai_ep_1 node. Name:'VitisAIExecutionProvider_vitis_ai_ep_1_0' Status Message: attrs_create_cif
public: virtual char const * __ptr64 __cdecl pybind11::error_already_set::what(void)const __ptr64
public: virtual char const * __ptr64 __cdecl pybind11::error_already_set::what(void)const __ptr64
public: virtual char const * __ptr64 __cdecl pybind11::error_already_set::what(void)const __ptr64
public: virtual char const * __ptr64 __cdecl pybind11::error_already_set::what(void)const __ptr64
PyInit_onnxruntime_pybind11_state
PyInit_onnxruntime_pybind11_state
PyInit_onnxruntime_pybind11_state
PyInit_onnxruntime_pybind11_state
PyInit_onnxruntime_pybind11_state
PyInit_onnxruntime_pybind11_state
PyInit_onnxruntime_pybind11_state
PyInit_onnxruntime_pybind11_state
PyInit_onnxruntime_pybind11_state
PyInit_onnxruntime_pybind11_state
PyInit_onnxruntime_pybind11_state
PyInit_onnxruntime_pybind11_state
PyInit_onnxruntime_pybind11_state
PyInit_onnxruntime_pybind11_state
PyInit_onnxruntime_pybind11_state
PyInit_onnxruntime_pybind11_state
public: void __cdecl pybind11::error_already_set::discard_as_unraisable(class pybind11::object) __ptr64
_PyArg_ParseTuple_SizeT
_PyObject_MakeTpCall
_PyErr_FormatFromCauseTstate
_Py_NewReference
_PyEval_EvalFrameDefault
_PyFunction_Vectorcall
_Py_NewReference
_PyEval_EvalFrameDefault
_Py_NewReference
_PyEval_EvalFrameDefault"