I want to know what version of python this is.
Some previous versions of python do not support +=
This is not likely the issue tho coz it’ll flag an error.
Now I noticed u are not saving the model after training.
U are passing the model into the training function as an argument and u are not returning it after training.
When u then pass the model into the testing function, it doesn’t pass the already trained model.
So try making model a global variable so that whatever changes u make to it from the training function, it’ll reflect on the testing function.
Or
After training the model, return the already trained model and make model = train()