-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from asu-cactus/revision
clean up code
- Loading branch information
Showing
15 changed files
with
1,846 additions
and
1,662 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,6 @@ | |
**/.ipynb_checkpoints/** | ||
**.tbl | ||
**/.vscode | ||
**/DeepMapping.egg-info | ||
**/DeepMapping.egg-info | ||
**.7z | ||
**.onnx |
322 changes: 128 additions & 194 deletions
322
DeepMapping/DeepMapping/byte_dictionary_compression.py
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import os | ||
import shutil | ||
import tensorflow as tf | ||
|
||
"""This script is used to convert the h5 model into onnx format, | ||
if you want to use onnxrunutime as backend. | ||
You are required to install tf2onnx by using pip. | ||
""" | ||
|
||
for root, dirs, files in os.walk("models/nas/tpch-s1/", topdown=False): | ||
for name in files: | ||
if '.h5' in name: | ||
model_name = name.split('.')[0] | ||
# h5 file | ||
model_path = os.path.join(root, name) | ||
|
||
model = tf.keras.models.load_model(model_path, compile=False) | ||
# save in pb | ||
model.save(os.path.join(root, model_name)) | ||
cmd = "python -m tf2onnx.convert --saved-model {} --output {}.onnx".format(os.path.join(root, model_name), | ||
os.path.join(root, model_name)) | ||
os.system(cmd) | ||
shutil.rmtree(os.path.join(root, model_name)) | ||
print(root, name, cmd) |
Oops, something went wrong.