Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for reference before assignment… #18640

Merged

Conversation

SamuelMarks
Copy link
Contributor

found through static analysis tooling

(more to go; or you can merge now and await further PRs; or you can request I move this to one PR per file or per module)

@gbaned gbaned requested a review from fchollet October 18, 2023 05:43
@sachinprasadhs sachinprasadhs added the keras-team-review-pending Pending review by a Keras team member. label Oct 18, 2023
@fchollet
Copy link
Member

Thanks for the PR. Unit tests are failing and the value-add of most of these changes is highly questionable (most of it is unreachable code which will only serve to decrease our coverage). Please double check each change and only keep the useful ones.

@fchollet fchollet removed the keras-team-review-pending Pending review by a Keras team member. label Oct 21, 2023
@@ -602,6 +602,8 @@ def get_config(self):
learning_rate = serialization_lib.serialize_keras_object(
self._learning_rate
)
else:
learning_rate = 0.5
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what this should be?

…Close` from `test_tf_data_compatibility` ; [keras/{ops/numpy.py,saving/saving_lib.py}] `black`en
@SamuelMarks
Copy link
Contributor Author

@fchollet Hmm ok I'll see what's causing these segfaults. In the meantime a lot of the patches are to solve the traceability problem, i.e., guarantee that the output variable is constructed as per below:

-        for output in ds.take(1):
-            output = output.numpy()
+        output = next(iter(ds)).numpy()

Should I change the PR to just that fix, and make separate PR(s) for the other cases?

@sachinprasadhs sachinprasadhs added the stat:awaiting keras-eng Awaiting response from Keras engineer label Oct 25, 2023
@gbaned
Copy link
Collaborator

gbaned commented Dec 1, 2023

Hi @SamuelMarks Can you please resolve conflicts? Thank you!

# Conflicts:
#	keras/layers/preprocessing/center_crop_test.py
#	keras/layers/preprocessing/random_crop_test.py
#	keras/layers/preprocessing/random_rotation_test.py
#	keras/layers/preprocessing/random_zoom_test.py
#	keras/layers/preprocessing/resizing_test.py
@SamuelMarks
Copy link
Contributor Author

@gbaned - Sure thing. Done.

@codecov-commenter
Copy link

codecov-commenter commented Dec 6, 2023

Codecov Report

Attention: Patch coverage is 56.25000% with 7 lines in your changes missing coverage. Please review.

Project coverage is 81.51%. Comparing base (8f5592b) to head (f2542e9).

Files with missing lines Patch % Lines
keras/src/applications/densenet.py 0.00% 2 Missing ⚠️
keras/src/models/model.py 33.33% 2 Missing ⚠️
keras/src/layers/attention/attention.py 0.00% 1 Missing ⚠️
keras/src/legacy/backend.py 0.00% 1 Missing ⚠️
keras/src/optimizers/base_optimizer.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #18640      +/-   ##
==========================================
+ Coverage   78.85%   81.51%   +2.66%     
==========================================
  Files         513      513              
  Lines       49250    49259       +9     
  Branches     9080     7952    -1128     
==========================================
+ Hits        38837    40155    +1318     
+ Misses       8543     7096    -1447     
- Partials     1870     2008     +138     
Flag Coverage Δ
keras 81.38% <56.25%> (+2.66%) ⬆️
keras-jax 65.04% <50.00%> (+2.67%) ⬆️
keras-numpy 57.54% <43.75%> (+0.15%) ⬆️
keras-tensorflow 66.29% <43.75%> (+2.67%) ⬆️
keras-torch 65.01% <50.00%> (+2.66%) ⬆️
keras.applications 80.33% <0.00%> (?)
keras.applications-jax 80.33% <0.00%> (?)
keras.applications-numpy 22.93% <0.00%> (?)
keras.applications-tensorflow 80.33% <0.00%> (?)
keras.applications-torch 80.06% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

…rop_test,random_crop_test}

ops/operation}.py] Resolve issues found through `flake8 --config setup.cfg .`
@gbaned
Copy link
Collaborator

gbaned commented Dec 29, 2023

Hi @SamuelMarks Can you please resolve conflicts? Thank you!

@SamuelMarks
Copy link
Contributor Author

@gbaned Done

@divyashreepathihalli divyashreepathihalli added the stat:awaiting keras-eng Awaiting response from Keras engineer label Sep 5, 2024
@gbaned
Copy link
Collaborator

gbaned commented Sep 9, 2024

Hi @SamuelMarks Can you please resolve conflicts? Thank you!

@gbaned gbaned added stat:awaiting response from contributor and removed stat:awaiting keras-eng Awaiting response from Keras engineer labels Sep 9, 2024
Copy link

This PR is stale because it has been open for 14 days with no activity. It will be closed if no further activity occurs. Thank you.

@github-actions github-actions bot added the stale label Sep 24, 2024
# Conflicts:
#	keras/src/layers/preprocessing/image_preprocessing/random_contrast_test.py
#	keras/src/layers/preprocessing/image_preprocessing/random_crop_test.py
#	keras/src/trainers/compile_utils.py
@SamuelMarks
Copy link
Contributor Author

@gbaned Sure thing, done

@sachinprasadhs
Copy link
Collaborator

@SamuelMarks , can you check the failing test, looks like some discrepancies in the channel axis.

Copy link

This PR is stale because it has been open for 14 days with no activity. It will be closed if no further activity occurs. Thank you.

@github-actions github-actions bot added the stale label Oct 11, 2024
…py] Return `output_shape` to being dependent on `image_data_format` on `test_tf_data_compatibility`
…py] Return `output_shape` to being dependent on `image_data_format` on `test_tf_data_compatibility`
@SamuelMarks
Copy link
Contributor Author

@sachinprasadhs That last commit should do the trick. Also merged in latest master.

…rop_test.py] Make tuple `output.shape` for comparison against `output_shape` from `image_data_format` on `test_tf_data_compatibility`
@sachinprasadhs sachinprasadhs added the keras-team-review-pending Pending review by a Keras team member. label Oct 11, 2024
@google-ml-butler google-ml-butler bot added kokoro:force-run ready to pull Ready to be merged into the codebase labels Oct 13, 2024
@fchollet fchollet merged commit 95ca6a6 into keras-team:master Oct 13, 2024
6 checks passed
@google-ml-butler google-ml-butler bot removed ready to pull Ready to be merged into the codebase kokoro:force-run labels Oct 13, 2024
@SamuelMarks
Copy link
Contributor Author

Requisite Spongebob meme:
spongebob

🎉 it merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keras-team-review-pending Pending review by a Keras team member. size:S
Projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

6 participants