Error when calling vgg.test() in Lesson 1


(WG) #1

The code:

b,p = vgg.test('data/dogscats/test', batch_size=2)

I get the following:

Found 0 images belonging to 0 classes.

ZeroDivisionError: integer division or modulo by zero


Predicting in Lesson 1
(Matthew Kleinsmith) #2

When I had this error it was because my test images weren’t in a subfolder within the test folder. My problem was solved once I moved the images from ./test to ./test/unknown.

The dogs_cats_redux notebook has an example of using the Vgg16.test method, in case you have other issues. (Disclaimer: The notebook might contain spoilers that could rob you of useful experiences.)

The way I found out what to do was to search “test” within the Lesson 1 discussion, but it took some digging to find a reply that answered my question.

Here’s the reply that answered my question:


Lesson 1 discussion
(WG) #3

cool thanks. yah i realized this late last night … added the “unknown” folder and things started working.


(Oshan) #4

Thanks a ton @Matthew