jatinchowdhury18 / RTNeural

Real-time neural network inferencing
BSD 3-Clause "New" or "Revised" License
582 stars 58 forks source link

Update model_utils.py #134

Closed dsagman closed 6 months ago

dsagman commented 6 months ago

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.

codecov-commenter commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

jatinchowdhury18 commented 6 months ago

Looks good on my end! Thanks for the contribution.