C3AE icon indicating copy to clipboard operation
C3AE copied to clipboard

I get "TypeError: 'NoneType' object is not callable" when train model

Open KhizarAziz opened this issue 5 years ago • 3 comments

Hi, Thankyou for the code, When i run the code, everything works totally fine except this,

When i execute this line, models.fit(train_gen, steps_per_epoch=len(trainset) // batch_size, epochs=250, callbacks=callbacks, validation_data=validation_gen, validation_steps=len(testset) // batch_size * 3)

i get this error: Screen Shot 2020-10-31 at 5 16 05 AM

TypeError: 'NoneType' object is not callable`

Kindly help with this, or please guide to a direction where i can debug the code and solve the issue, i shall be highly thankful.

KhizarAziz avatar Oct 31 '20 00:10 KhizarAziz

@KhizarAziz check your tensorflow version with my requirements in the repos which may save your time

StevenBanama avatar Nov 01 '20 06:11 StevenBanama

The problem was related to the age_data_generator. out2 = [candis.age.to_numpy(), np.array([two_point(x, category, interval) for x in candis.age.to_numpy()])] yield [imgs[:,0], imgs[:,1], imgs[:,2]], out2

I changed above code to: out2 = np.array([two_point(x, category, interval) for x in candis.age.to_numpy()]) yield [imgs[:,0], imgs[:,1], imgs[:,2]], out2

This fixed problem, but more questions arose here.....

  1. Why it fixed problem
  2. why were you return [age_numpy_array, two_point_representation_numpy]

i am confused, kindly help!!

KhizarAziz avatar Nov 01 '20 22:11 KhizarAziz

The problem was related to the age_data_generator. out2 = [candis.age.to_numpy(), np.array([two_point(x, category, interval) for x in candis.age.to_numpy()])] yield [imgs[:,0], imgs[:,1], imgs[:,2]], out2

I changed above code to: out2 = np.array([two_point(x, category, interval) for x in candis.age.to_numpy()]) yield [imgs[:,0], imgs[:,1], imgs[:,2]], out2

This fixed problem, but more questions arose here.....

  1. Why it fixed problem
  2. why were you return [age_numpy_array, two_point_representation_numpy]

i am confused, kindly help!!

@KhizarAziz age prediction in origin paper need two stage , meanwhile the age loss was composed by bucket loss and age MAE.The first stage gets age feature divided by age bucket and then compact these features to gen age prediction. "candis.age.to_numpy()" was add to calculate the loss of MAE.

StevenBanama avatar Nov 02 '20 06:11 StevenBanama