Failed test case: incorrect number of validation images when using split of 0.5 and a total of 123 images.
Expected:
a value close to 61 with absolute tolerance of +/- 1,
but got:
63.
Failed test case: incorrect number of (training, validation) images when using a split of 0.5 and 12 images (6 are zero-sized).
Expected:
(3, 3),
but got:
(6, 1)."
Could anyone help with this mistake?
I used a for-loop in the random shuffle of data, and use an if-statement when image size equal to 0, and else to count numbers of the loop when meeting the split size, to split âsourceâ into the train and validation directory.
I cannot find where the details went wrongâŠ
Send me your notebook via dm such that I can check where it went wrong. By clicking on the profile picture, you will see an option to message. There you can attach your notebook. Then we can discuss the issues here, under the topic you created.
At first I would suggest you to read the hints and instructions carefully, not only for this assignment, but for all. You need to understand it at first and do the steps sequentially as per the hint.
I am explaining to you what you need to do :
Create an empty list
Loop through all the files in the source directory
Check for file size >0 or not then print the given condition
Calculate the length of the training and validation sets based on the split size
Shuffle the list
Divide the into training set and validation set
Copy the files from the source directory to the training and validation directories
Hello! A have a problem with Failed Test Case:
Failed test case: incorrect number of (training, validation) images when using a split of 0.5 and 12 images (6 are zero-sized).
Expected:
(3, 3),
but got:
(4, 5)."
Please, could not you check my code? I canât figure out whatâs a problem. I believe I did everything through the hintsâŠ
Hello! I have an issue with submitting my assignment. Here is the grader output:
There was a problem compiling the code from your notebook. Details:
No module named âIPythonâ
NOTE: To prevent errors from the autograder, pleave avoid editing or deleting non-graded cells in this notebook . Please only put your solutions in between the ### START CODE HERE and ### END CODE HERE code comments, and refrain from adding any new cells.
Yes sure!
Itâs given in the hint : split size â 0.9. That is 90% for Training and 10% for Validation.
So use 0.9
Then if it doesnât work, send me your notebook via dm such that I can check where it went wrong. By clicking on the profile picture, you will see an option to message. There you can attach your notebook. Then we can discuss the issues here.
Hello!
I hope you are doing well. I was having a very similar problem to what you discussed in this topic, and wanted to try my luck asking you as well. If you have the time I would be very very happy!
Best Regards
Meryem
*I tried different ways to split the data, or remove the zero size files, but best I get this failed case (it seems to me that Iâm not able to discard 1 zero-size image but I can discard the rest so I do not understand the error Iâm making)
Failed test case: incorrect number of (training, validation) images when using a split of 0.5 and 12 images (6 are zero-sized).
Expected:
(3, 3),
but got:
(4, 4).
I have a similar problem with the Split_data function.
In my solution I first create a list of the file names in the source and then shuffle the list.
I create an empty clean_list and in a for loop I check if the files are not 0 size and append the filename in the clean_list.
Afterwards the clean_list is split in the training_list and the validation_list and the files are copied with these lists.
In my tests the split works also for different split sizes, but the grader output is:
Details of failed tests for split_data
Failed test case: failed to omit zero-length image. Tested with 6 images (one of zero length).
Expected:
5 files copied,
but got:
4.
Failed test case: incorrect number of training images when using split of 1.0 and a total of 123 images.
Expected:
123,
but got:
110.
Failed test case: incorrect number of training images when using split of 0.5 and a total of 123 images.
Expected:
a value close to 61 with absolute tolerance of +/- 1,
but got:
110.
Failed test case: incorrect number of validation images when using split of 0.5 and a total of 123 images.
Expected:
a value close to 61 with absolute tolerance of +/- 1,
but got:
13.
Failed test case: incorrect number of (training, validation) images when using a split of 0.5 and 12 images (6 are zero-sized).
Expected:
(3, 3),
but got:
(5, 1).
For me it seems that in the grader the split_size is not set correctly.
I ran into a similar problem. Be sure to check that your directory naming is consistent through the methods. You can have the logic correct but naming improperly will produce this error. ~ Rian
I would advise making heavy use of print() inside of the split_data() method. As in, after every assignment to a variable print out the results. You may also want to print out the input parameters to copyfile() so you have visibility. That should give you a trace log so you can see what is happening inside of that method at each step. ~ Rian