Skip to content

Commit a344f68

Browse files
Make linters happy
1 parent b8c00a7 commit a344f68

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

roboflow/adapters/rfapi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import json
22
import os
33
import urllib
4-
from typing import List, Optional
4+
from typing import List, Optional, Dict, Union
55

66
import requests
77
from requests.exceptions import RequestException
@@ -67,7 +67,7 @@ def start_version_training(
6767
"""
6868
url = f"{API_URL}/{workspace_url}/{project_url}/{version}/train?api_key={api_key}&nocache=true"
6969

70-
data = {}
70+
data: Dict[str, Union[str, int]] = {}
7171
if speed is not None:
7272
data["speed"] = speed
7373
if checkpoint is not None:

roboflow/core/version.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ def train(
307307
model_type: The type of model to train. Default depends on kind of project. It takes precedence over speed. You can check the list of model ids by sending an invalid parameter in this argument.
308308
checkpoint: A string representing the checkpoint to use while training
309309
epochs: Number of epochs to train the model
310-
plot: Whether to plot the training results. Default is `False`.
310+
plot_in_notebook: Whether to plot the training results. Default is `False`.
311311
312312
Returns:
313313
An instance of the trained model class
@@ -389,15 +389,15 @@ def live_plot(epochs, mAP, loss, title=""):
389389
write_line(line="Training failed")
390390
break
391391

392-
epochs: Union[np.ndarray, list]
392+
epoch_ids: Union[np.ndarray, list]
393393
mAP: Union[np.ndarray, list]
394394
loss: Union[np.ndarray, list]
395395

396396
if "roboflow-train" in models.keys():
397397
import numpy as np
398398

399399
# training has started
400-
epochs = np.array([int(epoch["epoch"]) for epoch in models["roboflow-train"]["epochs"]])
400+
epoch_ids = np.array([int(epoch["epoch"]) for epoch in models["roboflow-train"]["epochs"]])
401401
mAP = np.array([float(epoch["mAP"]) for epoch in models["roboflow-train"]["epochs"]])
402402
loss = np.array(
403403
[
@@ -414,23 +414,23 @@ def live_plot(epochs, mAP, loss, title=""):
414414
num_machine_spin_dots = ["."]
415415
title = "Training Machine Spinning Up" + "".join(num_machine_spin_dots)
416416

417-
epochs = []
417+
epoch_ids = []
418418
mAP = []
419419
loss = []
420420

421-
if (len(epochs) > len(previous_epochs)) or (len(epochs) == 0):
421+
if (len(epoch_ids) > len(previous_epochs)) or (len(epoch_ids) == 0):
422422
if plot_in_notebook:
423-
live_plot(epochs, mAP, loss, title)
423+
live_plot(epoch_ids, mAP, loss, title)
424424
else:
425-
if len(epochs) > 0:
425+
if len(epoch_ids) > 0:
426426
title = (
427-
title + ": Epoch: " + str(epochs[-1]) + " mAP: " + str(mAP[-1]) + " loss: " + str(loss[-1])
427+
title + ": Epoch: " + str(epoch_ids[-1]) + " mAP: " + str(mAP[-1]) + " loss: " + str(loss[-1])
428428
)
429429
if not first_graph_write:
430430
write_line(title)
431431
first_graph_write = True
432432

433-
previous_epochs = copy.deepcopy(epochs)
433+
previous_epochs = copy.deepcopy(epoch_ids)
434434

435435
time.sleep(5)
436436

0 commit comments

Comments
 (0)