keep-loving-pythonのブログ

Pythonを愛し続けたいです(Pythonが流行っている限りですが。。。)

解決策。tensorflow.lite.python.convert_phase.ConverterError: bad allocation

解決策。tensorflow.lite.python.convert_phase.ConverterError: bad allocation

エラー

tensorflow.lite.python.convert_phase.ConverterError: bad allocation

エラーの全体

Traceback (most recent call last):
  File "tf00.py", line 81, in <module>
    tflite_quant_model = converter.convert()
  File "C:\Users\XYZZ0\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\lite\python\lite.py", line 929, in wrapper
    return self._convert_and_export_metrics(convert_func, *args, **kwargs)
  File "C:\Users\XYZZ0\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\lite\python\lite.py", line 908, in _convert_and_export_metrics
    result = convert_func(self, *args, **kwargs)
  File "C:\Users\XYZZ0\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\lite\python\lite.py", line 1212, in convert
    return self._convert_from_saved_model(graph_def)
  File "C:\Users\XYZZ0\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\lite\python\lite.py", line 1095, in _convert_from_saved_model
    result = _convert_saved_model(**converter_kwargs)
  File "C:\Users\XYZZ0\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\lite\python\convert_phase.py", line 212, in wrapper
    raise converter_error from None  # Re-throws the exception.
  File "C:\Users\XYZZ0\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\lite\python\convert_phase.py", line 205, in wrapper
    return func(*args, **kwargs)
  File "C:\Users\XYZZ0\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\lite\python\convert.py", line 814, in convert_saved_model
    enable_mlir_converter=True)
  File "C:\Users\XYZZ0\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\lite\python\convert.py", line 311, in convert
    raise converter_error
tensorflow.lite.python.convert_phase.ConverterError: bad allocation

解決策

いま、作業してるんです。。。 デバッグの生中継中。。。 。。。。。
・・・
・・・

解決しました!!!!! (やはり単にPCのメモリ不足でした。) 不要ファイルを消して1GBほど空きをつくったら解決!!