-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add support for all models #884
Add support for all models #884
Conversation
Also wanted to say, this is really amazing work ! Thanks for doing this. |
@tikurahul - I've addressed all your points above and pushed a 3rd commit with these changes for review. I can rebase and squash everything afterwards (or squash merge the 3 commits), let me know your prefs. |
donkeycar/utils.py
Outdated
@@ -30,7 +30,7 @@ | |||
ONE_BYTE_SCALE = 1.0 / 255.0 | |||
|
|||
|
|||
class CString: | |||
class ComparisonString: |
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.
Nit: Call this EqMemorizedString
perhaps.
* Factor out model from interpreter so each model can be saved and run in .h5 / .savedmodel keras format, in tflite format or in tensorrt format * Improved KerasPilot interfaces to support the above * Added test for all models and all interpreters (TFflite excluded for 3d CNN and TRT excluded for LSTM as these are not supported respectively) * use expand_dims and squeeze instead of reshape and [0] UI improvements: * Add support for all model / interpreter combinations in training and model arena * Add options to sync only h5, savedmodel, tflite or tensorrt pilots to car * Fixed disabling of keyboard when switching from one screen to another Small improvements / fixes: * Added comment to status in train screen * Added better error message in trt conversion * Added seq length to lstm model str * Added shebang to profile.py Change on models: * Convert LSTM and 3D-CNN model from Sequential to Functional form, because transfer learning, i.e. continuing to train an already trained model, only works in the functional form of these two models. * Added new model KerasLinearMemory which reads in the last n actions, this facilitates smoother steering * Added support to inference from dictionary - passing by dictionary is used in training and supports augmentation * Renamed output layers alphabetically in order to avoid tflite bug which returns output tensors in that order General code changes: * Add Collator class which returns list of continuous records so sequence models, like rnn, 3dcnn, memory can be trained. Add test. * Add comparison string class (called EqMemorizedString) to better manage printing available user options. Used in get_model_by_type. * Reduced tolerance on keras test as we still see relative differences of 2e-5 (which is ok). * Check either relative or absolute tolerance as untrained models might return values >> 1 in keras test
40f2fc9
to
21f236d
Compare
1. fix the bugs originated from the latest commit b544241 (Add support for all other (except KerasLatent) models: (autorope#884)) 2. improve the approach for calculating saliency maps, 2.1 evaluate the effects of all output layers instead of one 2.2 correct the problematic math (blending the gradients of angle and throttle output layers together) from direct sum to square norm 2.3 calculate the saliency depending on the model type "linear" and "categorical" 3. modify the "draw_user_input", "draw_model_prediction", and "draw_steering_distribution" methods, seperate the image array for inference and the image array that labels are drawn on
1. fix the bugs originated from the latest commit b544241 (Add support for all other (except KerasLatent) models: (#884)) 2. improve the approach for calculating saliency maps, 2.1 evaluate the effects of all output layers instead of one 2.2 correct the problematic math (blending the gradients of angle and throttle output layers together) from direct sum to square norm 2.3 calculate the saliency depending on the model type "linear" and "categorical" 3. modify the "draw_user_input", "draw_model_prediction", and "draw_steering_distribution" methods, seperate the image array for inference and the image array that labels are drawn on
Add back support for all models
Overview
UI improvements
Small improvements / fixes
Change on models
General code changes