This file contains hidden or 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
| import torch.nn as N | |
| # Taken by https://github.com/Holmeyoung/crnn-pytorch/blob/master/models/crnn.py | |
| class BackwardHook(N.Module): | |
| def backward_hook(self, module, grad_input, grad_output): | |
| for g in grad_input: | |
| g[g != g] = 0 |
This file contains hidden or 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
| const mainFunc = () => { | |
| console.log("Hello World !") | |
| } | |
| if (require.main === module) { | |
| mainFunc() | |
| } |
This file contains hidden or 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
| # Show all redis values | |
| echo 'KEYS *' | redis-cli | sed 's/^/GET /' | redis-cli | |
| # Show all redis dictionaries | |
| echo 'KEYS *' | redis-cli | sed 's/^/HGETALL /' | redis-cli | |
This file contains hidden or 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
| # Switch to 5W mode | |
| sudo /usr/sbin/nvpmodel -m 1 | |
| # Switch to MAXN mode | |
| sudo /usr/sbin/nvpmodel -m 0 |
This file contains hidden or 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
| import onnx | |
| from onnx_tf.backend import prepare | |
| import numpy as np | |
| if __name__ == "__main__": | |
| model_path = "goat.onnx" | |
| onnx_model = onnx.load(model_path) | |
| onnx.checker.check_model(onnx_model,full_check=True) | |
| tf_model = prepare(onnx_model) |
This file contains hidden or 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
| import cv2 | |
| import os | |
| import numpy as np | |
| from shutil import rmtree | |
| if __name__ == "__main__": | |
| image_dir = "asdf" | |
| images = list(reversed(os.listdir(image_dir))) |
This file contains hidden or 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
| sudo dpkg --purge --force-remove-reinstreq $(dpkg --get-selections | grep -v "deinstall" | cut -f1 | grep cuda) |
This file contains hidden or 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
| #!/usr/bin/env python | |
| """ | |
| Bundle the site-packages of the current python environment into a zip file | |
| If you have any wheels at `$(pwd)/wheels`, those will be used instead of | |
| of the locally installed packages. For instance, if my pwd looked like | |
| wheels/ | |
| |-- numpy-1.11.2-cp27-cp27mu-manylinux1_x86_64.whl |
This file contains hidden or 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
| $IMAGE_NAME="ASDF" | |
| docker run -it --entrypoint /bin/bash $IMAGE_NAME |
This file contains hidden or 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
| Create a new dockerfile containing: | |
| FROM centos:6 | |
| ENV FOO=foofoo | |
| RUN export BAR=barbar | |
| RUN export BAZ=bazbaz && echo "$FOO $BAR $BAZ" | |
| Then build it. The output of the last step is: | |
| Step 4/4 : RUN export BAZ=bazbaz && echo "$FOO $BAR $BAZ" | |
| ---> Running in eb66196b238d |