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
#!/bin/bash | |
# Reloads `nvidia-smi` if you have had NVML/Library updates/mismatches, | |
# and you use a remote server which you cannot reboot for a whole host | |
# of scary reasons. Ensure nothing is running on the GPU, else this fails. | |
# Must be run with sudo. Be careful there are no display targets on the | |
# It is likely safe. | |
set -Eeuo pipefail | |
if [[ $UID != 0 ]]; then |
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
"""Tool to convert torchvision.resnet50 pretrained weights for flax. | |
This tool loads torchvision weights, unflattens them to a nested PyTree of | |
np.ndarray, which can be loaded to a ResNet50 flax model (assuming it has | |
the same tree structure). | |
A sample ResNet flax implementation which can load these weights is available | |
here: https://github.com/MasterSkepticista/detr/blob/main/models/resnet.py | |
Usage: |