cvdfoundation / kinetics-dataset

716 stars 92 forks source link

k600_extractor.sh throws errors during extraction #30

Closed pace577 closed 2 years ago

pace577 commented 2 years ago

Running bash k600_extractor.sh gives the following output (first 11 lines)

Extracting k600_targz/train/abseiling.tar.gz to k600/train                                                                                                   
Extracting k600_targz/train/play.tar.gz to k600/train                                                                                                        
tar (child): k600_targz/train/play.tar.gz: Cannot open: No such file or directory                                                                            
tar (child): Error is not recoverable: exiting now                                                                                                           
tar: Child returned status 2                                                                                                                                 
tar: Error is not recoverable: exiting now                                                                                                                   
Extracting k600_targz/train/glasses.tar.gz to k600/train                                                                                                     
tar (child): k600_targz/train/glasses.tar.gz: Cannot open: No such file or directory                                                                         
tar (child): Error is not recoverable: exiting now                                                                                                           
tar: Child returned status 2                                                                                                                                 
tar: Error is not recoverable: exiting now
...

Expected behaviour: No errors must be thrown during extraction

pace577 commented 2 years ago

It's probably caused by the following line of code:

tar_list=$(ls $curr_dl)

The file names in k400_targz/train and k400_targz/val contain spaces, so a file name is split up into multiple names when executing this line.

k600_extractor.sh ran without errors after I manually replaced all spaces in the tar file names with underscores.

XuyangShen commented 2 years ago

I guess the follwoing command is useful to do the replacement:

for file in *; do mv "$file" `echo $file | tr ' ' '_'` ; done
kinetics-cvdf commented 2 years ago

Do you have an updated script that runs without errors ? I can update the current one, if so. Thanks.

pace577 commented 2 years ago

Do you have an updated script that runs without errors ? I can update the current one, if so. Thanks.

Submitted a pull request (#34) with the working script, using the suggestion from the above comment. This seems to be working!