To suppress TensorFlow warnings (in a single python file, or in the __init__.py
of a package that depends on tensorflow):
[credit]
1 | # replace `import tensorflow as tf` with this line |
To suppress TensorFlow warnings (in a single python file, or in the __init__.py
of a package that depends on tensorflow):
[credit]
1 | # replace `import tensorflow as tf` with this line |
1 | CUDA_VISIBLE_DEVICES=0,1 taskset --cpu-list 0,1,2,3 python train.py |
实验室
实习
General
"Instead of trying to win something you never understood
Just play the game you know eventually you will you both look good
It’s silly to pretend to have something you don’t own
Instead of acting crazy chasing things that make you mad
Keep your heart ahead, it’ll lead you back to what you have
With every step you are closer to the place you need to be"
Suppose we have 2 github IDs, working account userA and personal account userB. This blog shows how to setup a git repo to commit & push with the proper identity.
For password-free github access, we use SSH (Secure Shell, basically a protocol for remote communication) to push to / pull from github repos. For identity verification, you will have a public key stored in github, and a private key stored locally. Some algorithm (RSA) will check if these two keys agree with each other.
For multiple github accounts, we need to generate the public/private key pair for each account:
1 | ssh-keygen # enter ~/.ssh/id_rsa_userA, <empty>, <empty> |
Then, add the generated public keys to github for each account:
1 | npm install -g hexo-cli |
1 | mkdir hexo_dir |
Create a github repo <username>.github.io
and edit _config.yml
:
1 | url: <username>.github.io |
Hexo’s built-in asset mechanism is hard to use. This post shows how to painlessly insert images when editing Hexo posts with Typora.
In Preferences:
File structure:
1 | hexo/ |
In some-post.md
:
1 | ![alt](some-post/image.png) |
Google’s search results are left aligned by default, which becomes a pain point when browsing with wide screens. After looking around for a while, I was finally able to center the webpage of google.com or scholar.google.com using the attached TamperMonkey scripts.
Before | After |
---|---|
A beautiful LaTeX-like feature for MarkDown! (auto-numbering for body, toc, sidebar)
[theme css] [demo document]
A dark theme for academic writing! [theme css] [demo document]
使用Noto Serif CJK SC字体进行中文渲染。