CascadeClassifier Assertion failed !empty

If you read it from file then first try /full/path/to/file/with/model because it may run code in different folder then you expect and it may not find file with model.