Skip to content

Instantly share code, notes, and snippets.

View dcalsky's full-sized avatar
🏠
Working from home

zuozuo dcalsky

🏠
Working from home
  • The University of Hong Kong
  • Hong Kong
View GitHub Profile
@dcalsky
dcalsky / ccdl.command
Created March 23, 2021 07:16 — forked from ayyybe/ccdl.command
Adobe Offline Package Generator v0.1.2 (macOS only)
#!/bin/bash
CYAN="$(tput bold; tput setaf 6)"
RESET="$(tput sgr0)"
clear
if command -v python3 > /dev/null 2>&1; then
if [ $(python3 -c "print('ye')") = "ye" ]; then
clear
@dcalsky
dcalsky / export_tf_model.py
Created October 14, 2019 23:51 — forked from zhanwenchen/export_tf_model.py
Minimal code to load a trained TensorFlow model from a checkpoint and export it with SavedModelBuilder
import os
import tensorflow as tf
trained_checkpoint_prefix = 'checkpoints/dev'
export_dir = os.path.join('models', '0') # IMPORTANT: each model folder must be named '0', '1', ... Otherwise it will fail!
loaded_graph = tf.Graph()
with tf.Session(graph=loaded_graph) as sess:
# Restore from checkpoint
loader = tf.train.import_meta_graph(trained_checkpoint_prefix + '.meta')