Comments (8)
Are you sure that there any images in the folders you are using? It recognizes only images with extensions .jpg
and .png
(small caps).
from pytorch-fid.
Ok. I missed that part. I changed the extension from .jpeg to .png and ran this again with the below error. As mentioned in Support grayscale images #41 - I did update the code to convert to RGB, but still, I ran into the below error:
0%| | 0/20 [00:00<?, ?it/s]
5%|▌ | 1/20 [00:00<00:06, 3.15it/s]
10%|█ | 2/20 [00:00<00:05, 3.32it/s]
15%|█▌ | 3/20 [00:00<00:04, 3.42it/s]
20%|██ | 4/20 [00:01<00:04, 3.51it/s]
25%|██▌ | 5/20 [00:01<00:04, 3.60it/s]
30%|███ | 6/20 [00:01<00:03, 3.62it/s]
35%|███▌ | 7/20 [00:01<00:03, 3.70it/s]
40%|████ | 8/20 [00:02<00:03, 3.72it/s]
45%|████▌ | 9/20 [00:02<00:02, 3.75it/s]
50%|█████ | 10/20 [00:02<00:02, 3.74it/s]
55%|█████▌ | 11/20 [00:02<00:02, 3.71it/s]
60%|██████ | 12/20 [00:03<00:02, 3.74it/s]
65%|██████▌ | 13/20 [00:03<00:01, 3.75it/s]
70%|███████ | 14/20 [00:03<00:01, 3.76it/s]
75%|███████▌ | 15/20 [00:04<00:01, 3.73it/s]
80%|████████ | 16/20 [00:04<00:01, 3.75it/s]
85%|████████▌ | 17/20 [00:04<00:00, 3.77it/s]
90%|█████████ | 18/20 [00:04<00:00, 3.79it/s]
95%|█████████▌| 19/20 [00:05<00:00, 3.79it/s]
100%|██████████| 20/20 [00:05<00:00, 3.73it/s]
0%| | 0/20 [00:01<?, ?it/s]
ValueError Traceback (most recent call last)
/usr/lib/python3.6/runpy.py in run_module(mod_name, init_globals, run_name, alter_sys)
203 run_name = mod_name
204 if alter_sys:
--> 205 return _run_module_code(code, init_globals, run_name, mod_spec)
206 else:
207 # Leave the sys module alone
7 frames
/content/drive/My Drive/pytorch-fid-master/pytorch_fid/fid_score.py in get_activations(files, model, batch_size, dims, cuda)
108
109 # Reshape to (n_images, 3, height, width)
--> 110 images = images.transpose((0, 3, 1, 2))
111 images /= 255
112
ValueError: axes don't match array
/usr/local/lib/python3.6/dist-packages/IPython/core/interactiveshell.py:2590: UserWarning: Unknown failure executing module: <pytorch_fid>
warn('Unknown failure executing module: <%s>' % mod_name)
from pytorch-fid.
There still seems to be something wrong with your images, or how they are loaded to arrays. Namely it appears as if images
does not have 4 dimensions at this point. Can you insert print(images.shape)
before the transpose line and post the result?
from pytorch-fid.
print(images.shape)
(50,)
from pytorch-fid.
Ok, I guess the size of the image varies. After adding the resize(299,299)- (to match the input of Inception model) to the line where images load solves the problem. Is there a better solution? After changing the code, I calculated FID score using --dims 768 which resulted in the FID score of 1.3
from pytorch-fid.
It is intentional that images are not automatically resized to the same size because there are several ways you can get images of different size to the same size (e.g. cropping, rescaling) and it is up to the user to decide which way works best for the used dataset.
Regarding the score you get, keep in mind that normal FID score uses the full 2048 dimensions. So you can not compare scores with 768 dimensions to the normal FID score, and they might behave entirely different. They might not even reflect human judgment of image quality.
from pytorch-fid.
I understand and agree with your comment. But, do you think we can still calculate FID score using 2048 dimensions for the samples less than 2048 in either of the two comparable folders(images). I know we might not have the full rank and covariance matrix and some NAN's. But, I'm just wondering if it makes sense to even give it a try?
from pytorch-fid.
It depends on what you do with the results. Maybe you would be able to compute an approximation to FID using less than 2048 samples, but it's hard to predict how good the quality of this approximation is. You surely can not compare against FID scores computed on full 2048 samples.
from pytorch-fid.
Related Issues (20)
- Imaginary component 3.1913775165377e+114 HOT 4
- How to calculate fid score with label HOT 1
- Can I implement the code with video data? HOT 1
- ValueError: Imaginary component 4.082076360939105e+125 HOT 12
- Batch-size Error HOT 5
- FID is a negative value HOT 2
- ValueError: batch_size should be a positive integer value, but got batch_size=0 HOT 8
- Invalid path error HELP PLS
- CUDNN_STATUS_NOT_SUPPORTED
- transforms: ToTensor(), Normalization HOT 1
- python: symbol lookup error: /home/xxx/miniconda3/envs/torch/lib/python3.7/site-packages/mk│ l/../../../libmkl_intel_thread.so.1: undefined symbol: __kmpc_global_thread_num HOT 1
- RuntimeError: unexpected EOF, expected 877244 more bytes. The file might be corrupted. HOT 3
- Query: WGAN-GP FID SCORE (PyTorch) HOT 1
- No module named pytorch_fid
- RuntimeError: cuDNN error: CUDNN_STATUS_NOT_INITIALIZED HOT 1
- batch_size error HOT 7
- A better way to compute the FID
- Faster computation for FID
- Dataset sizes
- Error while loading weights from url HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytorch-fid.