-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Remove useless global variable in custom_utils #454
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
Open
belotfa
wants to merge
6
commits into
OlafenwaMoses:master
Choose a base branch
from
belotfa:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
6681a02
Remove useless global variable in custom_utils
belotfa c14b135
Modify arguments
belotfa 42f8f1f
Update requirements.txt
belotfa 3aeddb6
Merge pull request #2 from belotfa/belotfa-patch-1
belotfa 73a703b
Update requirements to downgrade Pillow version.
belotfa 54c7ace
Update custom_utils.py
belotfa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| tensorflow | ||
| keras | ||
| numpy | ||
| pillow | ||
| pillow<7.0.0 | ||
| scipy | ||
| h5py | ||
| matplotlib | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree current implementation is not the best. However, this alternative isn't that better: each invocation on it will load exactly the same json.
If will let this change, should at least add a
withblock to make sure the file is closed properly:Agree on removing as much global variables as possible.
I don't fully understand why was on a global variable while the filename is a parameter... doesn't make sense for me, maybe I'm not seeing something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah but that's my point actually. With several instances of CustomImagePrediction running, each invocation will not load exactly the same json and the global variable CLASS_INDEX prevents us from running these instances at the same time.
This implementation is useful in other parts of codes in other "custom_utils.py" where some functions don't give a model_json in their parameters (but I checked, all functions that call this "custom_utils.py" give it).
PS : I may have misunderstood your concern, english is not my first language...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My point is tat previous version loaded the file only once. We should go to an implementation with only one file-reading but avoiding the point you mention. A bigger refactor is needed, as I see.
English is not my first language too
thanks for your PR, we need to wait for @OlafenwaMoses now