Skip to main content

Troubleshooting

How to enable debug logs

If you run into issues, it may be helpful to look at the debug logs of the DeepTone™ SDK. We use the python logging library. By default deeptone logs do not have any handlers so they will not be visible in your application unless you configure them.

If you already have logs using the logging module set up in your application, all you have to do is set the level of the DeepTone™ library to DEBUG for the most granular information.

deeptone_logger = logging.getLogger("deeptone")
deeptone_logger.setLevel("DEBUG")

If you need more help on setting up logging to stdout or a file check the examples below.

Basic logging to stdout example

If you are new to logging, below you can see a basic example to enable logs to stdout and enable deeptone debug logs.

import logging

# set up default basic stdout logging if you have not already
FORMAT = "%(asctime)s %(levelname)s %(threadName)s %(message)s"
logging.basicConfig(format=FORMAT)

# Set the level of the deeptone logger to DEBUG
deeptone_logger = logging.getLogger("deeptone")
deeptone_logger.setLevel("DEBUG")

# your code here
analyse_a_file()

For more details check out the python tutorial on logging.

Basic logging to a file example

If you are new to logging, below you can see a basic example to enable logs to a file and enable deeptone debug logs. If you need further assistance, you can send us a description of your issue, together with a logfile from your application run.

This will result in an example.log file in working directory of your application.

import logging

# set up default basic stdout logging if you have not already
FORMAT = "%(asctime)s %(levelname)s %(threadName)s %(message)s"
logging.basicConfig(filename='example.log', format=FORMAT)

# Set the level of the deeptone logger to DEBUG
deeptone_logger = logging.getLogger("deeptone")
deeptone_logger.setLevel("DEBUG")

# your code here
analyse_a_file()

For more details check out the python tutorial on logging.

DeepTone SDK and Tensorflow

The DeepTone python SDK cannot be used in the same context together with the tensorflow module. The reason for this is that the DeepTone SDK uses the Tensorflow C API internally to optimize performance and package size. Using the Tensorflow C library together with the Tensorflow python module results in a conflict when registering the devices to be used for the tensorflow graph execution. This is a limitation of Tensorflow that currently needs to be worked around. Let us know if you need this feature at support@oto.ai - we are happy to help you find a solution.