Spaces:
Runtime error
A newer version of the Gradio SDK is available:
5.9.1
title: EraV2s13 Raj
emoji: π
colorFrom: gray
colorTo: purple
sdk: gradio
sdk_version: 4.28.3
app_file: app.py
pinned: false
license: mit
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
Assignment 13
What is done and how
First I took Rohan shared input file, S13.ipy that is an S11 reference, where resnet code exists with lots of gradio examples. Ensured it builds successfully. Then I replaced the model to my model of S11. Prepared the code in such a way that on a condition check, the training and save of weights would happen in one path. Otherwise loading the weights, it would perform testing. This weight file is .pth.
Secondly I took Rohan shared input file, cifar10-baseline.ipynb that is an S13 reference, where pytorch lightning code of a working model is present. Ensured it builds successfully. Then I replaced the model to my model of S11. Prepared the code in such a way that on a condition check, the training and save of weights would happen in one path. Otherwise loading the weights, it would perform testing. This weight file is .ckpt.
Thirdly I started working on the gradio with gradcam and made it working for a single image input. I started working on the gradio with misclassified image display and made it working. I started working on the gradio with gradcam and made it working for a multiple images taken from cifar 10 misclassified images. I started working on the gradio with 10 images inputter and made it working. Here it can accept 1 images and display them. Does not do anything further. I integrated above said three items such as gradcam for multiple images, misclassified images, 10 images input in gradio. It works successfully.
Fourthly I started working on above working code to modularize it so that few py files will hold major part of code. I started working on HuggingFace and created / updated required files and it is made to be in working state in HuggingFace.
My spaces app has these features:
- Asks the user whether he/she wants to see GradCAM images and how many, and from which layer, allow opacity change as well
- Asks whether he/she wants to view misclassified images, and how many
- Allow users to upload new images, as well as provide 10 example images
In a tabbed interface, gradio framework is used and available for use from HuggingFace.
HuggingFace https://huggingface.co/spaces/raja5259/eraV2s13_raj Github https://github.com/rajayourfriend/EraV2/
Log of Training
Below is the log of training with pytorch lightning for 26 epochs with 6.6M params and got a test_acc of 91.28%
INFO:pytorch_lightning.utilities.rank_zero:GPU available: True (cuda), used: True INFO:pytorch_lightning.utilities.rank_zero:TPU available: False, using: 0 TPU cores INFO:pytorch_lightning.utilities.rank_zero:IPU available: False, using: 0 IPUs INFO:pytorch_lightning.utilities.rank_zero:HPU available: False, using: 0 HPUs Files already downloaded and verified Files already downloaded and verified INFO:pytorch_lightning.accelerators.cuda:LOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0] INFO:pytorch_lightning.callbacks.model_summary: | Name | Type | Params
0 | model | Net_S13 | 6.6 M
6.6 M Trainable params
0 Non-trainable params
6.6 M Total params
26.293 Total estimated model params size (MB)
Epochβ25:β100%
β197/197β[00:23<00:00,ββ8.53it/s,βloss=0.0844,βv_num=3,βval_loss=0.261,βval_acc=0.916]
INFO:pytorch_lightning.utilities.rank_zero:Trainer.fit
stopped: max_epochs=26
reached.
Files already downloaded and verified
Files already downloaded and verified
INFO:pytorch_lightning.accelerators.cuda:LOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0]
TestingβDataLoaderβ0:β100%
β40/40β[00:03<00:00,β11.30it/s]
βββββββββββββββββββββββββββββ³ββββββββββββββββββββββββββββ
β Test metric β DataLoader 0 β
β‘ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ©
β test_acc β 0.9128999710083008 β
β test_loss β 0.2818313539028168 β
βββββββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββ
[{'test_loss': 0.2818313539028168, 'test_acc': 0.9128999710083008}]