liyiying / Feature_Critic

Feature-Critic Networks for Heterogeneous Domain Generalisation
52 stars 11 forks source link

Error in model_PACS:test #5

Closed mfaraki closed 4 years ago

mfaraki commented 5 years ago

Hi During training after episode 50, while testing on the PACS dataset and photo is the test domain, I get this error in the "test" function in model_PACS.py

line 244, in test for per_slice in range(n_slices_test - 1): TypeError: 'float' object cannot be interpreted as an integer

There is 171 test images and the variable n_slices_test becomes 1.71. Would rounding the variable up be a good solution?

Thanks

liyiying commented 4 years ago

Hi, I think this is because of the different version of python 2 and 3. Try to change the division as '/' to '//' to make 'n_slices_test - 1' an integer.