diff --git a/hls4ml/converters/__init__.py b/hls4ml/converters/__init__.py index fb6507124..1ecf4b37f 100644 --- a/hls4ml/converters/__init__.py +++ b/hls4ml/converters/__init__.py @@ -93,7 +93,7 @@ def construct_keras_model(loader, node): print('Loading configuration from', config_file) with open(config_file, 'r') as file: - parsed_config = yaml.load(file, Loader=yaml.SafeLoader) + parsed_config = yaml.safe_load(file) return parsed_config def convert_from_config(config): diff --git a/test/pytest/test_cnn_mnist.py b/test/pytest/test_cnn_mnist.py index 274f25a54..2146e66bd 100644 --- a/test/pytest/test_cnn_mnist.py +++ b/test/pytest/test_cnn_mnist.py @@ -37,7 +37,7 @@ def mnist_model(): def hls_model(settings): io_type = settings[0] strategy = settings[1] - config = yaml.load(open('../../example-models/config-files/qkeras_mnist_cnn_config.yml').read()) + config = yaml.safe_load(open('../../example-models/config-files/qkeras_mnist_cnn_config.yml').read()) config['KerasJson'] = '../../example-models/keras/qkeras_mnist_cnn.json' config['KerasH5'] = '../../example-models/keras/qkeras_mnist_cnn_weights.h5' config['OutputDir'] = 'hls4mlprj_cnn_mnist_{}_{}'.format(io_type, strategy)