Closed YeeHoran closed 1 year ago
Hi,
You must first fill out a form here (https://research.google/tools/datasets/google-facial-expression/) to access the data. Later on, they will send the access email to you.
Thank you for your suggestion! However, after I filled out the form, there isn't further request for my email address to send me the dataset!
In addition, I met another problem when I run the code, and the error is the following:
Number of Trainable Parameters= 2919312 Traceback (most recent call last):
File "/home/yi/anaconda3/lib/python3.9/site-packages/spyder_kernels/py3compat.py", line 356, in compat_exec exec(code, globals, locals)
File "/home/yi/Documents/1. Research/3. public code/A-compact-embedding-for-facial-expression-similarity-main/FECNet 20221009.py", line 97, in
File "/home/yi/anaconda3/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 683, in next data = self._next_data()
File "/home/yi/anaconda3/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 1378, in _next_data return self._process_data(data)
File "/home/yi/anaconda3/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 1404, in _process_data data.reraise()
File "/home/yi/anaconda3/lib/python3.9/site-packages/torch/_utils.py", line 461, in reraise raise exception
TypeError: Caught TypeError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/home/yi/anaconda3/lib/python3.9/site-packages/torch/utils/data/_utils/worker.py", line 302, in _worker_loop
data = fetcher.fetch(index)
File "/home/yi/anaconda3/lib/python3.9/site-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/yi/anaconda3/lib/python3.9/site-packages/torch/utils/data/_utils/fetch.py", line 49, in
I have tried to debug the error for nearly 2 weeks, but still can't figure out the problem point. Could you tell me the reason, please? I'll appreciate your support very much!
Thank you again!
YeeHoran
Hi Yee,
The processing and giving access might take a few days!
For your error, it seems that the CSV file you used as an input to the dataloader is not consistence with the code; it expects to see an image address as a string (data.iloc[id, 1]) but you gave a float number. Could you please tell me, how did you prepare the input CSV file?
Thank you so much for your help! @AmirSh15
The way I got the csv file is as follows:
First, I open the website https://research.google/tools/datasets/google-facial-expression/, whose UI is as follows:
Then, a form appeared for me to fill it out, whose UI is as follows:
After I submitted the form, it redirected to a URL for downloading dataset and the UI is as follows:
Next, I download the "FEC_dataset.zip" file from the above download link. The zip file is too large to upload here, and the unzipped files's snapshot are as follows:
Finally, The screenshot of "faceexp-comparison-data-train-public.csv" is as follows:
On the other side, I have tried many times filling out the form in different days, but there isn't any response about the image files of the dataset.
I appreciate your kind support very much and looking forward to your reply!
Sincerely,
Yee Horan
Hi Yee,
Thanks for your detailed response. These are the files you need to run the code. Don't ask for more! The 'faceexp-comparison-data-train-public.csv' file contains the download link of the images you need for training. Here in the main code will download images. You can check the downloaded images in 'data/train'. Could you please check 'data/labels.csv' exists and print the contents?
Dear Amir,
Thank you so much for your quick reply! @AmirSh15
In fact, my 'data/labels.csv' is just the file 'faceexp-comparison-data-train-public.csv', its prints is like this:
Additionally, its sheet name is changed to 'labels' as the print shows. Is there anything wrong here? Thank you!
Thank you again for your support and I'm looking forward to your reply!
Best regards,
Yee Horan
Hi Yee,
That's fine! The 'faceexp-comparison-data-train-public.csv' contents seem alright. Could you please check that the code downloads (here 'data/train') the images and creates the label.csv (here 'data/labels.csv')
Dear Amir,
Thank you so much for your help!
The code do creates the label.csv (here 'data/labels.csv'), and its print is like this:
The code downloads(here 'data/train') the images. However, only 18 images are downloaded to 'data/train' and the error appeared in console is as follows:
I think the 'labels.csv' is generated rightly now, now the only problem is download the images, is it right?
For the the problem of download images, when I directly accessed the URLs of the images in explorer that are shown to have connection error above, they still cannot be accessed as well, and the result is as like this,
So, could you help me how to download the images in this situation, please?
I appreciate your kind support and suggestions very much and looking forward to your reply!
Best regards,
Yee Horan
Hi Yee,
It seems your connection has issues because I could open the file with the address 'https://farm3.static.flickr.com/2380/2324144987_527b9ff32b_b.jpg' in my browser.
Dear Amir,
Thank you for your suggestion and I'll check the connection issue next.
Now, when I tried to debug it to the breakpoint line that is highlighted in red on the left side in the following picture, it stuck in the condition that is highlighted in green on the right side. This lasts for more than 12 hours, and nothing happened but this.
Could you tell me why this happened and is it in normal status, please?
Thank you very much and I'm looking forward to your reply!
Sincerely,
Yee Horan
Hi Yee,
I think this error happens when your images don't exist in the expected path, or at least some of them. Did you download all the images?
Dear Amir,
No, I tried to download the images many times for a whole day, but every time only these 18 images could be downloaded, as the following print shows:
But, the code of downloading images seems running smooth from the console that is highlighted in the following screenshot:
Now, I wonder is it possible that you share me your downloaded images, please? I could comply with any licenses or requirements that you need. And, that'll favor and speed up my current research a lot.
Thank you so much for your consistent support and I'm looking forward to your reply!
Sincerely,
Yee Horan
Dear Amir,
I debugged the code today, and found something that may cause the problem of very few downloaded images.
I enter the download_image() (line129) function in 'image_downloader.py', it runs correctly from line130 to line 139, which analyze the 'label.csv' into 8 dictionaries with items of image url and its cropped coordinates, and create 8 get image threads from t1 to t8 as well.
However, from line141, when threads start() with such as 't1.start()' that begin to download images, problems arise as follows,
Take t1.start() as an example, other threads come across the same problem.
There are 39173 image URLs in name_dic1 which t1 could use to download, crop and save new cropped images, but only two image URLs are processed by t1, because only these two URLs are printed on the console: as the following screenshot shows, in which both of the print(key) line that prints out the image URLs to be accessed and the printed out URLs in console are highlighted by green circles.
But, all the other image URLs except the above two can be accessed and displayed on my browser, and I accessed a lot of them by my browser. So, for t1 and other threads from t2 to t8, only the printed out image URLs on the console are processed by the threads, yet most of them are never processed at all.
To find out the reason for this, I tried to enter the concrete definition of _start_new_thread() in 'threading.py',that is highlighted in green in the following screenshot, but it didn't enter at all but run to its following lines directly.
So, these are all I found today, and in a word, I think most of the image URLs are not processed at all, and only very few of them are processed, so each time, only 18 cropped images are in the 'train' folder. But I can't find out the reason.
Could you tell me whether my above opinion is correct or not, please? If not, what causes the download image problem really, please?
I hope you could initiate it, and that will favor me and speed up my research greatly!
Thank you for your time and consistent support again!
Best regards,
Yee Horan
Hi Yee,
I updated the code. Please check and let me know if you have any difficulties.
Dear Amir,
Thank you so much for your time and work to update the code so quickly! I'll run it at once.
Dear Amir,
I run the preprocess.py code, in which download_image() is carried out. I run it 5 times, and the numbers of downloaded images into 'data/train' path are 888, 890, 866, 897, 888. In addition, each time it stuck when downloading the same file named 'http://farm8.staticflickr.com/7377/10177367366_9279901900_b.jpg' whose last location in 'faceexp-comparison-data-train-public.csv' is row 435140 that near the end, and is shown as follows,
I have no idea why only about 900 images were downloaded at each time, and why it is always the same file that seems to cause download error and stop the program running.
Thank you so much for your consistent help and support and I am looking forward to your reply!
Best regards,
Yee Horan
Hi Yee, It's weird because I ran the code without any problem. Could you please post your error?
Dear Amir,
Thank you for your quick reply!
The errors shown in the console are like this:
Additionally, I tried to access the file 'https://farm8.staticflickr.com/7377/10177367366_9279901900_b.jpg' from browser directly, but the result is like this:
So, do you know the reason why it always carried out in this way, please?
Thank you very much for your time and support!
Hi Yee,
I'm sure that this is something related to your internet provider. I tried again today, and everything is running smoothly.
Dear Amir,
Thank you very much for your time and support on this!
I'll check my internet connection to solve it .
Thank you again for your consistent support!
Hi, @YeeHoran Were you able to download all the images? I am also having the same issue.
Hi, @anonydeven #8 has the links to download the image, which is also presented as follows: https://research.google/tools/datasets/google-facial-expression/
Hope this help you!
@YeeHoran Yes, I did follow the links and EULA agreement but I am able to download 70K images only. The rest says "Not Complete Image ...". Were you able to download the complete dataset?
There is only csv files for test and train dataset, but without the images mentioned in the csv.
Could you send me the link where to download the overall images, please?
Thank you!