You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary:
While attempting to install Keras in editable mode and running the test suite, several tests failed. I now detail the steps I followed to reproduce the errors.
Steps to Reproduce:
Created a conda environment:
conda create -n keras python=3.10
conda activate keras
Cloned the Keras repository:
git clone https://github.com/keras-team/keras.git
cd keras
The test suite reported the following short summary:
FAILED integration_tests/jax_custom_fit_test.py::test_custom_fit - TypeError: test_custom_fit.<locals>.CustomModel.train_step() missing 1 required positional argument: 'data'
FAILED integration_tests/tf_distribute_training_test.py::test_model_fit - RuntimeError: Virtual devices cannot be modified after being initialized
FAILED integration_tests/torch_custom_fit_test.py::test_custom_fit - AttributeError: 'CustomModel' object has no attribute 'zero_grad'
FAILED integration_tests/torch_workflow_test.py::TorchWorkflowTest::test_keras_layer_in_nn_module - AssertionError: 0 != 2
FAILED keras/src/applications/applications_test.py::ApplicationsTest::test_application_notop_custom_input_shape_EfficientNetV2B0_channels_first - tensorflow.python.framework.errors_impl.InvalidArgumentError: {{function_node __wrapped__BroadcastTo_device_/job:localhost/replica:0/task:0/device:CPU:0}} Unable to broadcast tensor of shape [3] to tensor of shape [1,3,1,1] [Op:BroadcastTo]
FAILED keras/src/applications/applications_test.py::ApplicationsTest::test_application_notop_custom_input_shape_EfficientNetV2B1_channels_first - tensorflow.python.framework.errors_impl.InvalidArgumentError: {{function_node __wrapped__BroadcastTo_device_/job:localhost/replica:0/task:0/device:CPU:0}} Unable to broadcast tensor of shape [3] to tensor of shape [1,3,1,1] [Op:BroadcastTo]
FAILED keras/src/applications/applications_test.py::ApplicationsTest::test_application_notop_custom_input_shape_EfficientNetV2B2_channels_first - tensorflow.python.framework.errors_impl.InvalidArgumentError: {{function_node __wrapped__BroadcastTo_device_/job:localhost/replica:0/task:0/device:CPU:0}} Unable to broadcast tensor of shape [3] to tensor of shape [1,3,1,1] [Op:BroadcastTo]
FAILED keras/src/applications/applications_test.py::ApplicationsTest::test_application_notop_custom_input_shape_EfficientNetV2B3_channels_first - tensorflow.python.framework.errors_impl.InvalidArgumentError: {{function_node __wrapped__BroadcastTo_device_/job:localhost/replica:0/task:0/device:CPU:0}} Unable to broadcast tensor of shape [3] to tensor of shape [1,3,1,1] [Op:BroadcastTo]
FAILED keras/src/applications/applications_test.py::ApplicationsTest::test_application_pooling_EfficientNetV2B0_channels_first - tensorflow.python.framework.errors_impl.InvalidArgumentError: {{function_node __wrapped__BroadcastTo_device_/job:localhost/replica:0/task:0/device:CPU:0}} Unable to broadcast tensor of shape [3] to tensor of shape [1,3,1,1] [Op:BroadcastTo]
FAILED keras/src/applications/applications_test.py::ApplicationsTest::test_application_pooling_EfficientNetV2B1_channels_first - tensorflow.python.framework.errors_impl.InvalidArgumentError: {{function_node __wrapped__BroadcastTo_device_/job:localhost/replica:0/task:0/device:CPU:0}} Unable to broadcast tensor of shape [3] to tensor of shape [1,3,1,1] [Op:BroadcastTo]
FAILED keras/src/applications/applications_test.py::ApplicationsTest::test_application_pooling_EfficientNetV2B2_channels_first - tensorflow.python.framework.errors_impl.InvalidArgumentError: {{function_node __wrapped__BroadcastTo_device_/job:localhost/replica:0/task:0/device:CPU:0}} Unable to broadcast tensor of shape [3] to tensor of shape [1,3,1,1] [Op:BroadcastTo]
FAILED keras/src/applications/applications_test.py::ApplicationsTest::test_application_pooling_EfficientNetV2B3_channels_first - tensorflow.python.framework.errors_impl.InvalidArgumentError: {{function_node __wrapped__BroadcastTo_device_/job:localhost/replica:0/task:0/device:CPU:0}} Unable to broadcast tensor of shape [3] to tensor of shape [1,3,1,1] [Op:BroadcastTo]
= 12 failed, 12870 passed, 346 skipped, 8 xfailed, 2 xpassed in 1283.05s (0:21:23) =
Errors include:
TypeError in integration_tests/jax_custom_fit_test.py.
RuntimeError in integration_tests/tf_distribute_training_test.py.
InvalidArgumentError in several applications_test.py cases involving EfficientNetV2.
Environment Details:
Python Version: 3.10
Anaconda Version: 4.10.1
Operating System: Ubuntu 22.04.5 LTS
Additional Notes:
I avoided using pip_build.py as I wanted to install Keras in editable mode.
The error logs seem to point towards compatibility or configuration issues:
The integration_tests errors suggest issues with the test setup for jax and torch.
The applications_test.py errors may involve TensorFlow device configurations or input shapes for EfficientNetV2.
Request for Help:
I expect the test suite to pass without any errors, or at least there should be no critical errors, so:
Should these failures be ignored, or are they indicative of underlying issues?
Should I reconfigure the backend to run these tests?
Are there additional dependencies or configurations required to run the full test suite?
I guess that I should use both Jax and PyTorch as backends to run these tests, but maybe I can just ignore them if I am using TensorFlow. Or am I missing something? However, any assistance in resolving this issue would be greatly appreciated.
Thank you.
The text was updated successfully, but these errors were encountered:
Summary:
While attempting to install Keras in editable mode and running the test suite, several tests failed. I now detail the steps I followed to reproduce the errors.
Steps to Reproduce:
git clone https://github.com/keras-team/keras.git cd keras
python3.10 -m pip install -e .
python3.10 -u -m pytest --cov=keras --cov-report=html:htmlcov --cov-report=xml:coverage.xml > keras_golden_run
Observed Behavior:
The test suite reported the following short summary:
Errors include:
integration_tests/jax_custom_fit_test.py
.integration_tests/tf_distribute_training_test.py
.applications_test.py
cases involvingEfficientNetV2
.Environment Details:
Additional Notes:
pip_build.py
as I wanted to install Keras in editable mode.integration_tests
errors suggest issues with the test setup forjax
andtorch
.applications_test.py
errors may involve TensorFlow device configurations or input shapes forEfficientNetV2
.Request for Help:
I expect the test suite to pass without any errors, or at least there should be no critical errors, so:
I guess that I should use both Jax and PyTorch as backends to run these tests, but maybe I can just ignore them if I am using TensorFlow. Or am I missing something? However, any assistance in resolving this issue would be greatly appreciated.
Thank you.
The text was updated successfully, but these errors were encountered: