Skip to content

Instantly share code, notes, and snippets.

@laol777
laol777 / gist:e3e574c45a1bf4afd64ce0341173a479
Created November 28, 2023 16:25
disable vm if there's no active ssh session for 3h
#!/bin/bash
# Timeout value in seconds (3 hours = 10800 seconds)
timeout=10800
# Initialize a counter
count=0
# Run in a loop
while true; do
import simulation
import helper
import copy
import time
from collections import defaultdict
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms, datasets, models
import torch.nn.functional as F
import torch.nn as nn
import tensorflow as tf
import numpy as np
from tensorflow.python.platform import gfile
import cv2
import glob
from matplotlib import pyplot as plt
# import tqdm
def random_pad_to_size(img, size, mask, pad_symmetric, use_random):
from MODEL import *
from EVALUATION import *
timer = Timer()
timer.start()
netG_act_o_1 = dict(size=2, index=0)
netG_act_o_2 = dict(size=2, index=1)
netD_act_o = dict(size=1, index=0)