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

Update model_utils.py #134

Merged
merged 1 commit into from
Mar 30, 2024
Merged

Conversation

dsagman
Copy link
Contributor

@dsagman dsagman commented Mar 28, 2024

I ran into an issue where save_layer in model_utils.py is giving me an error that: AttributeError: 'Dense' object has no attribute 'output_shape'

I found that layer.output.shape works, but isn't always a tuple, which runs afoul of the JSON encoder. So I added check for that too.

I modified the code and it seems to work on Macos, Linux, Windows. I've included my debugging print statements so you can see what I was looking at.

I ran into an issue where save_layer in model_utils.py is giving me an error that: AttributeError: 'Dense' object has no attribute 'output_shape'

I found that layer.output.shape works, but isn't always a tuple, which runs afoul of the JSON encoder. So I added check for that too.

I modified the code and it seems to work on Macos, Linux, Windows. I've included my debugging print statements so you can see what I was looking at.
@jatinchowdhury18 jatinchowdhury18 linked an issue Mar 30, 2024 that may be closed by this pull request
@codecov-commenter
Copy link

codecov-commenter commented Mar 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.70%. Comparing base (0b0e5d0) to head (3aff951).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #134   +/-   ##
=======================================
  Coverage   95.70%   95.70%           
=======================================
  Files          58       58           
  Lines        3892     3892           
=======================================
  Hits         3725     3725           
  Misses        167      167           

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

@jatinchowdhury18
Copy link
Owner

Looks good on my end! Thanks for the contribution.

@jatinchowdhury18 jatinchowdhury18 merged commit a8ae9c5 into jatinchowdhury18:main Mar 30, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Problem saving Tensorflow models
3 participants