HI, I tried to convert keras model to TFLite but I got this error
is there any limitation size that is able to convert to TFLite?
My keras model’s size is about 4GB
Error Message is this
RuntimeError: size too big: 18446744071577324113 details: string length exceeds max size
whole Error message
Traceback (most recent call last):
File “/data/yerin/DLRM_Criteo/DLRM.py”, line 151, in
tflite_model = converter.convert()
File “/home/yerin/anaconda3/envs/rec/lib/python3.9/site-packages/tensorflow/lite/python/lite.py”, line 1065, in wrapper
return self._convert_and_export_metrics(convert_func, *args, **kwargs)
File “/home/yerin/anaconda3/envs/rec/lib/python3.9/site-packages/tensorflow/lite/python/lite.py”, line 1042, in _convert_and_export_metrics
result = convert_func(self, *args, **kwargs)
File “/home/yerin/anaconda3/envs/rec/lib/python3.9/site-packages/tensorflow/lite/python/lite.py”, line 1531, in convert
self._freeze_keras_model()
File “/home/yerin/anaconda3/envs/rec/lib/python3.9/site-packages/tensorflow/lite/python/convert_phase.py”, line 215, in wrapper
raise error from None # Re-throws the exception.
File “/home/yerin/anaconda3/envs/rec/lib/python3.9/site-packages/tensorflow/lite/python/convert_phase.py”, line 205, in wrapper
return func(*args, **kwargs)
File “/home/yerin/anaconda3/envs/rec/lib/python3.9/site-packages/tensorflow/lite/python/lite.py”, line 1482, in _freeze_keras_model
_convert_to_constants.convert_variables_to_constants_v2_as_graph(
File “/home/yerin/anaconda3/envs/rec/lib/python3.9/site-packages/tensorflow/python/framework/convert_to_constants.py”, line 1253, in convert_variables_to_constants_v2_as_graph
frozen_func = _construct_concrete_function(func, output_graph_def,
File “/home/yerin/anaconda3/envs/rec/lib/python3.9/site-packages/tensorflow/python/framework/convert_to_constants.py”, line 1097, in _construct_concrete_function
new_func = wrap_function.function_from_graph_def(output_graph_def,
File “/home/yerin/anaconda3/envs/rec/lib/python3.9/site-packages/tensorflow/python/eager/wrap_function.py”, line 661, in function_from_graph_def
wrapped_import = wrap_function(_imports_graph_def, )
File “/home/yerin/anaconda3/envs/rec/lib/python3.9/site-packages/tensorflow/python/eager/wrap_function.py”, line 625, in wrap_function
func_graph.func_graph_from_py_func(
File “/home/yerin/anaconda3/envs/rec/lib/python3.9/site-packages/tensorflow/python/framework/func_graph.py”, line 1055, in func_graph_from_py_func
func_outputs = python_func(*func_args, **func_kwargs)
File “/home/yerin/anaconda3/envs/rec/lib/python3.9/site-packages/tensorflow/python/eager/wrap_function.py”, line 83, in call
return self.call_with_variable_creator_scope(self._fn)(*args, **kwargs)
File “/home/yerin/anaconda3/envs/rec/lib/python3.9/site-packages/tensorflow/python/eager/wrap_function.py”, line 89, in wrapped
return fn(*args, **kwargs)
File “/home/yerin/anaconda3/envs/rec/lib/python3.9/site-packages/tensorflow/python/eager/wrap_function.py”, line 655, in _imports_graph_def
importer.import_graph_def(graph_def, name=“”)
File “/home/yerin/anaconda3/envs/rec/lib/python3.9/site-packages/tensorflow/python/util/deprecation.py”, line 576, in new_func
return func(*args, **kwargs)
File “/home/yerin/anaconda3/envs/rec/lib/python3.9/site-packages/tensorflow/python/framework/importer.py”, line 406, in import_graph_def
return _import_graph_def_internal(
File “/home/yerin/anaconda3/envs/rec/lib/python3.9/site-packages/tensorflow/python/framework/importer.py”, line 510, in _import_graph_def_internal
results = c_api.TF_GraphImportGraphDefWithResults(
RuntimeError: size too big: 18446744071577324113 details: string length exceeds max size