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
/train/n02112137/n02112137_3351.JPEG 96 | |
/train/n02112137/n02112137_14715.JPEG 96 | |
/train/n02112137/n02112137_8996.JPEG 96 | |
/train/n02112137/n02112137_8952.JPEG 96 | |
/train/n02112137/n02112137_482.JPEG 96 | |
/train/n02112137/n02112137_2023.JPEG 96 | |
/train/n02112137/n02112137_10146.JPEG 96 | |
/train/n02112137/n02112137_13505.JPEG 96 | |
/train/n02112137/n02112137_6212.JPEG 96 | |
/train/n02112137/n02112137_9200.JPEG 96 |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
def fine_labels(): | |
fine_labels = [ | |
'apple', # id 0 | |
'aquarium_fish', | |
'baby', | |
'bear', | |
'beaver', | |
'bed', | |
'bee', | |
'beetle', |
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
# ======================================================================================================================== | |
import openai | |
openai.api_key = | |
# ======================================================================================================================== | |
# >>> len(a[31:60]), len(a[60:]) | |
# (29, 40) | |
import os | |
from tqdm import tqdm, trange |
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
def save_latest(epoch, model_dir, model, optimizer, scheduler=None, wandb_id=None): | |
"""Saves latest epoch's weights and other necessary things to resume | |
""" | |
model_states = { | |
"epoch": epoch, | |
"state_dict": model.state_dict(), | |
"opt_state_dict": optimizer.state_dict(), | |
"sch_state_dict": scheduler.state_dict() if scheduler != None else None, | |
"wandb_id_save": wandb_id, #----> Remove this if you don't use wandb for logging | |
} |
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
import torchvision | |
model_conv = torchvision.models.resnet18(pretrained=True) | |
for name, param in model_conv.named_parameters(): | |
if not("fc" in name): | |
param.requires_grad = False | |
print(name, param.requires_grad) |
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
# From Polyfjord - https://youtu.be/Q9IRHmfGDrU?t=17 | |
names = ["gold", | |
"chilli_pepper", | |
"crystal_blue", | |
"aquamarine", | |
"army_green", | |
"neon_yellow", | |
"caramel", | |
"pumpkin_orange", |
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
import pprint as pp | |
fine_labels = [ | |
'apple', # id 0 | |
'aquarium_fish', | |
'baby', | |
'bear', | |
'beaver', | |
'bed', | |
'bee', |
NewerOlder