klrc / racnn-pytorch Goto Github PK
View Code? Open in Web Editor NEWpytorch implementation of Recurrent Attention CNN.
pytorch implementation of Recurrent Attention CNN.
Hi @klrc ,
First of all great repo!!
I have been trying to replicate the results of this paper. Till now, I am stuck at 68% top-1 accuracy. I saw you got 69 top-1 accuracy at 23 epochs. Did you get chance to complete the training and get better results?
Please Let me know thanks!
Thank you very much for your code; it has been a great help to me! However, I have a small question I'd like to ask, if I can still receive your response.
Firstly: After I call the save_img function, the saved image appears as a blank gray image (Image 1). I debugged the issue and it seems to be related to the tensor_to_img function during the value conversion process (since I can display the magnified image using plt.imshow() with colors, as shown in Image 2). However, I'm unsure which step is causing the current problem. Do you have any suggestions?
Secondly: I have a minor question about an image similar to my Image 2. Why are there gradient-like color blocks on top? Even when I initially load the original image using plt.imshow(), it also contains these color blocks, rather than the most original image.
Image 1๏ผ
Image 2๏ผ
Note: I've replaced the dataset with one related to medical images.
Hi, @klrc
I just started learning RA-CNN, and I have a question for you. Here is your result on the testset:
[2019-12-31 20:06:50] :: Testing on test set ...
[2019-12-31 20:07:10] Accuracy clsf-0@top-1 (201/725) = 79.95050%
[2019-12-31 20:07:10] Accuracy clsf-0@top-5 (201/725) = 94.61634%
[2019-12-31 20:07:10] Accuracy clsf-1@top-1 (201/725) = 74.25743%
[2019-12-31 20:07:10] Accuracy clsf-1@top-5 (201/725) = 91.39851%
[2019-12-31 20:07:10] Accuracy clsf-2@top-1 (201/725) = 74.62871%
[2019-12-31 20:07:10] Accuracy clsf-2@top-5 (201/725) = 90.71782%
I wonder why the accuracy of clsf-0, clsf-1, clsf-2 decreases in order? Shouldn't clsf-2 be a more fine-grained region compared with clsf-1 and clsf-0?
I got the same results on my datasets. If you can help me with this question, I would appreciate it very much! Thank you!
Thanks for making this project, It's convenient for me to implement RACNN in PyTorch.๐
However, When I load a trained model, I found the error below:
(pytorch) root@server:~/RACNN-PYTORCH_orchids# python test.py
Traceback (most recent call last):
File "test.py", line 12, in <module>
model = torch.load("build/racnn_mobilenetv2_cub200-e40se401635929775.pt")
File "/home/user/anaconda3/envs/pytorch/lib/python3.8/site-packages/torch/serialization.py", line 607, in load
return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
File "/home/user/anaconda3/envs/pytorch/lib/python3.8/site-packages/torch/serialization.py", line 882, in _load
result = unpickler.load()
File "/home/user/anaconda3/envs/pytorch/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1130, in __getattr__
raise AttributeError("'{}' object has no attribute '{}'".format(
AttributeError: 'RACNN' object has no attribute '__echo_apn'
After I did some researches, I guess the problem is the typo of these two lines:
RACNN-pytorch/src/recurrent_attention_network_paper/forge.py
Lines 94 to 95 in 323780d
If I replace model.state_dict
with model.state_dict()
, the probelm was solved.
Hope you can edit your code, thanks for your hard work!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.