-
Notifications
You must be signed in to change notification settings - Fork 124
Performance is not good when using my dataset. #16
Comments
@bemoregt your image size is way bigger than MNIST (256x256) so there are few hyperparameters you'd have to tweak to improve performance. For example, you can try increasing the patch size, the number of patches per glimpse and the number of glimpses taken per image. You could also try to increase the hidden size of the RNN, etc. |
Hi, @kevinzakka I'll try that. My images are 256x256xgrayscale, thin line defects in solarcell problems. and Image Augmented to 5000 images/class by retinex filtering/Unsharp masking/filp/flop, etc. Thanks in advance. from @bemortgt. |
There is no error happen at my train time. Otherwise, When my CNN+Supervised Learning, final accuracy is 99.8% with my same dataset. What's wrong with me? Thanks at any rate. from @bemoregt. |
My Params here: glimpse network paramsglimpse_arg = add_argument_group('Glimpse Network Params') core network paramscore_arg = add_argument_group('Core Network Params') reinforce paramsreinforce_arg = add_argument_group('Reinforce Params') data paramsdata_arg = add_argument_group('Data Params') training paramstrain_arg = add_argument_group('Training Params') other paramsmisc_arg = add_argument_group('Misc.') |
@bemoregt Thank you for sharing your parameters, when/if I can make it work I will report on the performance. One thing I can think of is the implementation has room for improvement e.g. not start with center patches but do it randomly (if I am not wrong this implementation uses center point to initialize). I think @kevinzakka might have a better answer but the performance could also be related to many things. Do you think your CNN classification might be overfitting? Attention model might be sort of doinga similar effect to augmenting your data. Or perhaps it is the nature of your data. Attention models seem to work better only in particular cases (for example it performs better on a noise added MNIST set than MNIST) |
On the other hand I think my problem might be that my images are 427x240 RGB images. I have come across some posts on pytorch having problem with certain image sizes and they are advised to tackle it by using adaptive avg pooling layer rather than avg pooling.. I will try that. Or maybe it has to do with center initialization or padding of tensors. Still no idea. @kevinzakka |
@bemoregt It seems the implementation is not yet a full implementation of the paper. Just fyi as that might be the issue with performance. It never occurred to me to check the closed issues- I did go through the code but not in great detail as the readme gave the impression that it was a full paper implementation as it was also featured on torch blogs - and I am new to pytorch. |
I am also thinking of using this model for my own dataset, but from your discussion it looks like: 1/ This implementation is not complete yet, 2/ This RAM only works well on certain datasets, so its power is actually quite limited. Am I right? |
@linzhiqiu 1. Ok, my comment was not a caution against using this repository, I was just guessing why people have performance issues, and it seems I am not the only one. So yes, I think it would be better if everything is more clear. The repo is a functional minimal example of the model working with MNIST minus some aspects (like random search), it also does not yet support batches etc. although it is written in a way to (so I suppose it is left undone) So imho, expanding it to my dataset and having a close to the paper implementation is not as straightforward as I thought it was through the blog and readme here. Alas, this is a good opportunity for people to contribute to the project, but personally I am new to pytorch.
|
@duygusar @linzhiqiu the way I wrote the repository makes it so that you just have to modify the The only current problem with this implementation is that the retina module is not efficient and the CPU version currently runs faster than the GPU. I had in mind to write a custom kernel using the new cpp extension but never got the time. |
@kevinzakka I did write my own dataloader, I have mentioned it here #19 And I was only referring to your comment here about batches #1 Since the suggested consensus way of handling different size of images for pytorch didn't solve my problem, and considering your comment I assumed it could be the batches or the color channel. |
WHat changes did you do to make this repo work for your custom data, I am having troubles converting my data to mnist format. Is there any easier way to use this for own data? |
Hi, @kevinzakka
I entered my own data with MNIST Format(256x256, Gray Images, 5000 Images/class)
But Performance is not good.
What's wrong with me?
Epoch: 196/500 - LR: 0.000300
0.8s - loss: 1.055 - acc: 100.000: 100%|█████████| 217/217 [00:00<00:00, 267.85it/s]
train loss: 0.834 - train acc: 62.212 - val loss: 1.192 - val acc: 54.167
Epoch: 197/500 - LR: 0.000300
0.8s - loss: -0.885 - acc: 100.000: 100%|████████| 217/217 [00:00<00:00, 273.63it/s]
train loss: 0.568 - train acc: 60.369 - val loss: 0.844 - val acc: 54.167
Epoch: 198/500 - LR: 0.000300
0.8s - loss: 0.780 - acc: 100.000: 100%|█████████| 217/217 [00:00<00:00, 270.30it/s]
train loss: 0.565 - train acc: 57.604 - val loss: 1.076 - val acc: 50.000
Epoch: 199/500 - LR: 0.000300
0.8s - loss: 3.553 - acc: 0.000: 100%|███████████| 217/217 [00:00<00:00, 271.82it/s]
train loss: 0.678 - train acc: 58.525 - val loss: 0.533 - val acc: 58.333
Epoch: 200/500 - LR: 0.000300
0.8s - loss: 0.116 - acc: 100.000: 100%|█████████| 217/217 [00:00<00:00, 272.74it/s]
train loss: 0.651 - train acc: 58.986 - val loss: 1.418 - val acc: 45.833
Epoch: 201/500 - LR: 0.000300
0.8s - loss: 5.108 - acc: 0.000: 100%|███████████| 217/217 [00:00<00:00, 275.17it/s]
train loss: 0.779 - train acc: 63.594 - val loss: 0.921 - val acc: 62.500
Epoch: 202/500 - LR: 0.000300
0.8s - loss: 1.587 - acc: 0.000: 100%|███████████| 217/217 [00:00<00:00, 270.84it/s]
train loss: 0.830 - train acc: 58.525 - val loss: 0.746 - val acc: 58.333
[!] No improvement in a while, stopping training.
Thanks.
from @bemoregt.
The text was updated successfully, but these errors were encountered: