C3D-tensorflow
C3D-tensorflow copied to clipboard
Issue with convert_images_to_list.sh
The files seems to split randomly the dataset, a 25-75 split normally should have representatives from each category. This is not the case. If for instance a category exists in one list it can be absent from another. Could be a jot versioning issue ?
This should work better.
#!/bin/bash
train.list test.list COUNT=-1 for folder in $1/* do echo $folder COUNT=$[$COUNT + 1] for imagesFolder in "$folder"/* do
if ( (( ( RANDOM % $2 ) )) > 1 ); then
echo "$imagesFolder" $COUNT >> train.list
else
echo "$imagesFolder" $COUNT >> test.list
fi
done
done
@PBRAOS Thx .This is work for me !
Do you run it on Linux or Windows? How can I run it? I run it on Linux. There are some errors. I need your help. bash convert_images_to_list.sh /home/yan/yan1/tu 4 convert_images_to_list.sh: 行 2: $'\r': 未找到命令 convert_images_to_list.sh: 行 22: $'\r': 未找到命令 convert_images_to_list.sh: 行 27: 未预期的符号 `$'do\r'' 附近有语法错误
Pm me
Pb
On 31 Mar 2019, at 10:29, Yan-echo [email protected] wrote:
Do you run it on Linux or Windows? How can I run it? I run it on Linux. There are some errors. I need your help. bash convert_images_to_list.sh /home/yan/yan1/tu 4 convert_images_to_list.sh: 行 2: $'\r': 未找到命令 convert_images_to_list.sh: 行 22: $'\r': 未找到命令 convert_images_to_list.sh: 行 27: 未预期的符号 `$'do\r'' 附近有语法错误
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
This should work better. #!/bin/bash
train.list test.list COUNT=-1 for folder in $1/* do echo $folder COUNT=$[$COUNT + 1] for imagesFolder in "$folder"/* do
if ( (( ( RANDOM % $2 ) )) > 1 ); then echo "$imagesFolder" $COUNT >> train.list else echo "$imagesFolder" $COUNT >> test.list fi
done
done
This code can work, but it can't generate class, how should I do it?