pythonlessons / mltu

Machine Learning Training Utilities (for TensorFlow and PyTorch)
MIT License
160 stars 100 forks source link

Compatibility Issue with Protobuf Versions in TensorFlow ONNX Conversion #40

Open Turkisec opened 7 months ago

Turkisec commented 7 months ago

I'm new to Machine Learning and I'm currently encountering an issue during my machine learning training related to TensorFlow and ONNX.

When installing TensorFlow, I encounter an error related to onnxconverter-common and protobuf version compatibility. The specific error message is: onnxconverter-common 1.14.0 requires protobuf==3.20.2, but you have protobuf 4.25.1 which is incompatible.

Attempting to resolve this by installing protobuf 3.20.2 leads to another issue where TensorFlow requires protobuf 4.25.1. Furthermore, I'm experiencing an error that states: 'FuncGraph' object has no attribute '_captures'. This occurs during the training process, specifically at Epoch 122 with the message 'early stopping'.

Current Environment: mltu-1.1.7 tensorflow-2.12.0 Python 3.9.18 Win 11

I've tried adjusting the versions of protobuf to meet the requirements of both tensorflow and onnxconverter-common, but this leads to a conflict where either of the two doesn't function properly.

Can someone guide me on how to resolve these compatibility issues? Any suggestions on how to correctly configure my environment or alternative approaches to avoid these conflicts would be greatly appreciated.

pythonlessons commented 3 months ago

Hello, usually I also receive issues with protobuf... it may depend on other libraries, and other libraries may require newer versions, so it is really headache sometimes. But try to install newest onnx and onnxruntime libraries, try to use older tensorflow versions, try different variations