Skip to content

Commit

Permalink
Update for pyyaml 6.0 (#435)
Browse files Browse the repository at this point in the history
* yaml.safe_load instead of yaml.load

* Use yaml.safe_load in converters __init__.py
  • Loading branch information
thesps committed Nov 5, 2021
1 parent 738d673 commit eaedb4d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion hls4ml/converters/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion test/pytest/test_cnn_mnist.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit eaedb4d

Please sign in to comment.