Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
UltralyticsAssistant committed Oct 15, 2024
1 parent 8519789 commit 6fb9b9d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 18 deletions.
10 changes: 2 additions & 8 deletions gcp/wave_pytorch_gcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,11 @@ def runexample(H, model, str, lr=0.001, amsgrad=False):

cuda = torch.cuda.is_available()
os.makedirs(f"{pathr}models", exist_ok=True)
name = (
f"{data[:-4]}{H[:]}{lr:g}lr{str}".replace(", ", ".")
.replace("[", "_")
.replace("]", "_")
)
name = f"{data[:-4]}{H[:]}{lr:g}lr{str}".replace(", ", ".").replace("[", "_").replace("]", "_")

tica = time.time()
device = torch.device("cuda:0" if cuda else "cpu")
print(
f'Running {name} on {device.type}\n{torch.cuda.get_device_properties(0) if cuda else ""}'
)
print(f'Running {name} on {device.type}\n{torch.cuda.get_device_properties(0) if cuda else ""}')

if not os.path.isfile(pathd + data):
os.system(f"wget -P data/ https://storage.googleapis.com/ultralytics/{data}")
Expand Down
6 changes: 1 addition & 5 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ def train(H, model, str, lr=0.001):

cuda = torch.cuda.is_available()
os.makedirs(f"{pathr}models", exist_ok=True)
name = (
f"{data[:-4]}{H[:]}{lr:g}lr{str}".replace(", ", ".")
.replace("[", "_")
.replace("]", "_")
)
name = f"{data[:-4]}{H[:]}{lr:g}lr{str}".replace(", ", ".").replace("[", "_").replace("]", "_")
print(f"Running {name}")

device = select_device()
Expand Down
6 changes: 1 addition & 5 deletions train_tf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ def runexample(H, model, str):
tf.set_random_seed(1)
path = "data/"
os.makedirs(f"{path}models", exist_ok=True)
name = (
f"{data[:-4]}{H[:]}{lr:g}lr{eps:g}eps{str}".replace(", ", "_")
.replace("[", "_")
.replace("]", "_")
)
name = f"{data[:-4]}{H[:]}{lr:g}lr{eps:g}eps{str}".replace(", ", "_").replace("[", "_").replace("]", "_")

tica = time.time()
device = "/gpu:0" if cuda else "/cpu:0"
Expand Down

0 comments on commit 6fb9b9d

Please sign in to comment.