-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Attempt to change all Numpy calls to Torch calls #357
Draft
TRex22
wants to merge
72
commits into
jacobgil:master
Choose a base branch
from
TRex22:torch-replacement-for-numpy
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.
Draft
Changes from 1 commit
Commits
Show all changes
72 commits
Select commit
Hold shift + click to select a range
59aef83
Attempt to compute all base and grad-cam class operations using torch…
TRex22 8bf7524
Bump other version :cop:
TRex22 fa8c8d7
Fix import to use torch over Numpy :cop:
TRex22 ce52619
Convert max pos 2 to a tensor :cop:
TRex22 73f720b
Begin to find and migrate more numpy calls to torch calls. Also fix s…
TRex22 f96e21f
Make use of one strategy for resizing tensors over the cv2 call :cop:
TRex22 ef3dcf5
Go back to CPU for cv2 resizing :cop:
TRex22 bf9b9db
Attempt to get the image scaling function working with torch :cop:
TRex22 df9b035
Use torch tensor only on the list of numpy arrays :cop:
TRex22 fe6cb92
Use the correct torch function :cop:
TRex22 f58e88c
Attempt to fix torch resizing :cop:
TRex22 594bb0c
Use a transpose for the experiment. Investigate a proper resize later…
TRex22 f4739c2
Remove the resize for now :cop:
TRex22 995550e
Disable the scaling function from changing dimensions (for now)
TRex22 02b9451
Create a simple benchmark :cop:
TRex22 cc557d1
Add in basic GradCAM :cop:
TRex22 71f51d0
Continue to write a simple GradCAM :cop:
TRex22 06efbc4
Properly name the variable :cop:
TRex22 f2578d7
Fix the tensor stack :cop:
TRex22 a4d2750
Fix the dimensions needed for Resnet :cop:
TRex22 7058122
Change target layer :cop:
TRex22 1a77f74
Add in cuda profiling :cop:
TRex22 f4b759a
Create the large loop :cop:
TRex22 15ca2be
Refactor code to share some algorithm :cop:
TRex22 fb1b50d
Fix batching :cop:
TRex22 62c1709
Add in proper output :cop:
TRex22 045d200
Add in loading bar :cop:
TRex22 20d7ebd
Reduce to 100 images :cop:
TRex22 d9dbc85
Attempt using a bigger batchsize :cop:
TRex22 2756d71
Bump batch_size :cop:
TRex22 4200b99
Add workflow test :cop:
TRex22 1489ea3
Fix tensor issue in 1.4.6 :cop:
TRex22 8833ee1
Add inner loop :cop:
TRex22 d492c36
Force cuda device :cop:
TRex22 5bbdf8f
Fix loop range :cop:
TRex22 b8a8a46
Make use of the tensor resize transform :cop:
TRex22 77b19da
Add in a different model to benchmark too :cop:
TRex22 85f196b
handle the tensor list size :cop:
TRex22 a56647d
Correct the dimensions in the resize :cop:
TRex22 922d2d3
pdate using the correct models in the benchmark :cop:
TRex22 5dbc8bc
Fix output :cop:
TRex22 20ab49f
Improve benchmarking and make a functions file to store reusable comp…
TRex22 3eceb84
Make use of shared functions :cop:
TRex22 901391e
Attempt to fix device memory issues :cop:
TRex22 2748c5c
Select the last CNN model as the GradCAM taregt layer :scientist:
TRex22 b77aa5b
Fix spelling miskate :cop:
TRex22 65f1b1f
Attempt another way to iterate through model params :cop:
TRex22 9c274be
Handle multiple models :cop:
TRex22 eaaf0a9
Fix feature bug :cop:
TRex22 dc5db2e
Cleanup progress :cop:
TRex22 c75bbef
Add in method benchmark :cop:
TRex22 915b99f
Patch in cuda device support :cop:
TRex22 0305eec
Fix cuda device call :cop:
TRex22 0da12a0
Fix cuda device call :cop:
TRex22 82f71e7
Work on a single image benchmark :cop:
TRex22 199815c
Disable cpu benchmarking :cop:
TRex22 cf020cf
output the resultant image and allow inputting a image :cop:
TRex22 9513c86
Allow for output saving for a snaity check :cop:
TRex22 186c14b
Allow for output saving for a snaity check :cop:
TRex22 b6d2202
Allow for output saving for a snaity check :cop:
TRex22 84a0689
Allow for output saving for a snaity check :cop:
TRex22 18f8d8e
Open image :cop:
TRex22 8eaf1b7
Open image :cop:
TRex22 b805465
Change to simple model :cop:
TRex22 7393e77
try with trained weights :cop:
TRex22 193c9f2
try with trained weights :cop:
TRex22 a3d327b
Add in cuda device support for gradients and activations :cop:
TRex22 15de5ed
Fix typo :cop:
TRex22 9e38599
Attempt to force a difference FakeTensorMode :scientist:
TRex22 ed64d06
Attempt to patch issue with pytorch 2.0 :cop:
TRex22 273bd81
Make more meaningful changes extracted from another branch :cop:
TRex22 9ed4c9b
Remove TODO :cop:
TRex22 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 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 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 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 |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
|
||
setuptools.setup( | ||
name='grad-cam', | ||
version='1.4.6', | ||
version='1.4.7', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just did this so on my compute node I know which version Im working with. In terms of what the real version bump would be Im open to a more major potential bump - as the final version of these changes would be substantial and potentially breaking |
||
author='Jacob Gildenblat', | ||
author_email='[email protected]', | ||
description='Many Class Activation Map methods implemented in Pytorch for classification, segmentation, object detection and more', | ||
|
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.
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.
For now Im trying to do minimal changes to create a proof of concept I can run.
Ive left this as a draft PR and its still definitely a WIP
I just find the PR user interface is great to observe changes
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.
Related to: #356