Skip to content

Instantly share code, notes, and snippets.

View p-geon's full-sized avatar
🕊️
pigeoning

Pigeon p-geon

🕊️
pigeoning
View GitHub Profile
GPUconfig = tf.ConfigProto(
gpu_options=tf.GPUOptions(
allow_growth=True
, visible_device_list="0"
)
, device_count={"GPU":1}
)
with tf.Session(graph=graph, config=GPUconfig) as sess:
print(sess.run())
# 画面をリフレッシュしつつアタッチ
tmux a -d
import numpy as np
print("range: ", np.max(X[0]), np.min(X[0]))
@p-geon
p-geon / useful_python.py
Last active June 16, 2018 11:17
pythonで便利なやつら
# 便利なデバッガー
import pdb; pdb.set_trace()
# 毎回書くアレ。画像表示用関数
import matplotlib.pyplot as plt
def single_color(img, dpi=72):
plt.figure(dpi=dpi)
plt.imshow(img)
plt.show()
plt.close()