wandb 0.20.1rc20250604__py3-none-musllinux_1_2_aarch64.whl → 0.21.0__py3-none-musllinux_1_2_aarch64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- wandb/__init__.py +3 -6
- wandb/__init__.pyi +24 -23
- wandb/analytics/sentry.py +2 -2
- wandb/apis/importers/internals/internal.py +0 -3
- wandb/apis/internal.py +3 -0
- wandb/apis/paginator.py +17 -4
- wandb/apis/public/api.py +85 -4
- wandb/apis/public/artifacts.py +10 -8
- wandb/apis/public/files.py +5 -5
- wandb/apis/public/projects.py +44 -3
- wandb/apis/public/registries/{utils.py → _utils.py} +12 -12
- wandb/apis/public/registries/registries_search.py +2 -2
- wandb/apis/public/registries/registry.py +19 -18
- wandb/apis/public/reports.py +64 -8
- wandb/apis/public/runs.py +16 -23
- wandb/automations/__init__.py +10 -10
- wandb/automations/_filters/run_metrics.py +0 -2
- wandb/automations/_utils.py +0 -2
- wandb/automations/actions.py +0 -2
- wandb/automations/automations.py +0 -2
- wandb/automations/events.py +0 -2
- wandb/bin/gpu_stats +0 -0
- wandb/bin/wandb-core +0 -0
- wandb/cli/beta.py +1 -7
- wandb/cli/cli.py +0 -30
- wandb/env.py +0 -6
- wandb/integration/catboost/catboost.py +6 -2
- wandb/integration/kfp/kfp_patch.py +3 -1
- wandb/integration/sb3/sb3.py +3 -3
- wandb/integration/ultralytics/callback.py +6 -2
- wandb/plot/__init__.py +2 -0
- wandb/plot/bar.py +30 -29
- wandb/plot/confusion_matrix.py +75 -71
- wandb/plot/histogram.py +26 -25
- wandb/plot/line.py +33 -32
- wandb/plot/line_series.py +100 -103
- wandb/plot/pr_curve.py +33 -32
- wandb/plot/roc_curve.py +38 -38
- wandb/plot/scatter.py +27 -27
- wandb/proto/v3/wandb_internal_pb2.py +366 -385
- wandb/proto/v3/wandb_settings_pb2.py +2 -2
- wandb/proto/v3/wandb_telemetry_pb2.py +10 -10
- wandb/proto/v4/wandb_internal_pb2.py +352 -356
- wandb/proto/v4/wandb_settings_pb2.py +2 -2
- wandb/proto/v4/wandb_telemetry_pb2.py +10 -10
- wandb/proto/v5/wandb_internal_pb2.py +352 -356
- wandb/proto/v5/wandb_settings_pb2.py +2 -2
- wandb/proto/v5/wandb_telemetry_pb2.py +10 -10
- wandb/proto/v6/wandb_internal_pb2.py +352 -356
- wandb/proto/v6/wandb_settings_pb2.py +2 -2
- wandb/proto/v6/wandb_telemetry_pb2.py +10 -10
- wandb/sdk/artifacts/_generated/__init__.py +12 -1
- wandb/sdk/artifacts/_generated/input_types.py +20 -2
- wandb/sdk/artifacts/_generated/link_artifact.py +21 -0
- wandb/sdk/artifacts/_generated/operations.py +9 -0
- wandb/sdk/artifacts/_validators.py +40 -2
- wandb/sdk/artifacts/artifact.py +163 -21
- wandb/sdk/artifacts/storage_handlers/s3_handler.py +42 -1
- wandb/sdk/backend/backend.py +1 -1
- wandb/sdk/data_types/base_types/media.py +9 -7
- wandb/sdk/data_types/base_types/wb_value.py +6 -6
- wandb/sdk/data_types/saved_model.py +3 -3
- wandb/sdk/data_types/table.py +41 -41
- wandb/sdk/data_types/trace_tree.py +12 -12
- wandb/sdk/interface/interface.py +8 -19
- wandb/sdk/interface/interface_shared.py +7 -16
- wandb/sdk/internal/datastore.py +18 -18
- wandb/sdk/internal/handler.py +4 -74
- wandb/sdk/internal/internal_api.py +54 -0
- wandb/sdk/internal/sender.py +23 -3
- wandb/sdk/internal/sender_config.py +9 -0
- wandb/sdk/launch/_project_spec.py +3 -3
- wandb/sdk/launch/agent/agent.py +3 -3
- wandb/sdk/launch/agent/job_status_tracker.py +3 -1
- wandb/sdk/launch/utils.py +3 -3
- wandb/sdk/lib/console_capture.py +66 -19
- wandb/sdk/lib/printer.py +6 -7
- wandb/sdk/lib/progress.py +1 -3
- wandb/sdk/lib/service/ipc_support.py +13 -0
- wandb/sdk/lib/{service_connection.py → service/service_connection.py} +20 -56
- wandb/sdk/lib/service/service_port_file.py +105 -0
- wandb/sdk/lib/service/service_process.py +111 -0
- wandb/sdk/lib/service/service_token.py +164 -0
- wandb/sdk/lib/sock_client.py +8 -12
- wandb/sdk/wandb_init.py +1 -5
- wandb/sdk/wandb_require.py +9 -21
- wandb/sdk/wandb_run.py +23 -137
- wandb/sdk/wandb_settings.py +233 -80
- wandb/sdk/wandb_setup.py +2 -13
- {wandb-0.20.1rc20250604.dist-info → wandb-0.21.0.dist-info}/METADATA +1 -3
- {wandb-0.20.1rc20250604.dist-info → wandb-0.21.0.dist-info}/RECORD +94 -120
- wandb/sdk/internal/flow_control.py +0 -263
- wandb/sdk/internal/internal.py +0 -401
- wandb/sdk/internal/internal_util.py +0 -97
- wandb/sdk/internal/system/__init__.py +0 -0
- wandb/sdk/internal/system/assets/__init__.py +0 -25
- wandb/sdk/internal/system/assets/aggregators.py +0 -31
- wandb/sdk/internal/system/assets/asset_registry.py +0 -20
- wandb/sdk/internal/system/assets/cpu.py +0 -163
- wandb/sdk/internal/system/assets/disk.py +0 -210
- wandb/sdk/internal/system/assets/gpu.py +0 -416
- wandb/sdk/internal/system/assets/gpu_amd.py +0 -233
- wandb/sdk/internal/system/assets/interfaces.py +0 -205
- wandb/sdk/internal/system/assets/ipu.py +0 -177
- wandb/sdk/internal/system/assets/memory.py +0 -166
- wandb/sdk/internal/system/assets/network.py +0 -125
- wandb/sdk/internal/system/assets/open_metrics.py +0 -293
- wandb/sdk/internal/system/assets/tpu.py +0 -154
- wandb/sdk/internal/system/assets/trainium.py +0 -393
- wandb/sdk/internal/system/env_probe_helpers.py +0 -13
- wandb/sdk/internal/system/system_info.py +0 -248
- wandb/sdk/internal/system/system_monitor.py +0 -224
- wandb/sdk/internal/writer.py +0 -204
- wandb/sdk/lib/service_token.py +0 -93
- wandb/sdk/service/__init__.py +0 -0
- wandb/sdk/service/_startup_debug.py +0 -22
- wandb/sdk/service/port_file.py +0 -53
- wandb/sdk/service/server.py +0 -107
- wandb/sdk/service/server_sock.py +0 -286
- wandb/sdk/service/service.py +0 -252
- wandb/sdk/service/streams.py +0 -425
- wandb/sdk/wandb_metadata.py +0 -623
- {wandb-0.20.1rc20250604.dist-info → wandb-0.21.0.dist-info}/WHEEL +0 -0
- {wandb-0.20.1rc20250604.dist-info → wandb-0.21.0.dist-info}/entry_points.txt +0 -0
- {wandb-0.20.1rc20250604.dist-info → wandb-0.21.0.dist-info}/licenses/LICENSE +0 -0
wandb/apis/public/reports.py
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
import ast
|
4
4
|
import json
|
5
|
+
import re
|
5
6
|
import urllib
|
6
7
|
|
7
8
|
from wandb_gql import gql
|
@@ -32,9 +33,11 @@ class Reports(SizedPaginator["BetaReport"]):
|
|
32
33
|
user {
|
33
34
|
username
|
34
35
|
photoUrl
|
36
|
+
email
|
35
37
|
}
|
36
38
|
spec
|
37
39
|
updatedAt
|
40
|
+
createdAt
|
38
41
|
}
|
39
42
|
cursor
|
40
43
|
}
|
@@ -60,7 +63,7 @@ class Reports(SizedPaginator["BetaReport"]):
|
|
60
63
|
super().__init__(client, variables, per_page)
|
61
64
|
|
62
65
|
@property
|
63
|
-
def
|
66
|
+
def _length(self):
|
64
67
|
# TODO: Add the count the backend
|
65
68
|
if self.last_response:
|
66
69
|
return len(self.objects)
|
@@ -111,11 +114,15 @@ class BetaReport(Attrs):
|
|
111
114
|
WARNING: this API will likely change in a future release
|
112
115
|
|
113
116
|
Attributes:
|
117
|
+
id (string): unique identifier of the report
|
114
118
|
name (string): report name
|
115
|
-
|
116
|
-
|
117
|
-
|
119
|
+
display_name (string): display name of the report
|
120
|
+
description (string): report description
|
121
|
+
user (User): the user that created the report (contains username and email)
|
122
|
+
spec (dict): the spec of the report
|
123
|
+
url (string): the url of the report
|
118
124
|
updated_at (string): timestamp of last update
|
125
|
+
created_at (string): timestamp when the report was created
|
119
126
|
"""
|
120
127
|
|
121
128
|
def __init__(self, client, attrs, entity=None, project=None):
|
@@ -124,7 +131,16 @@ class BetaReport(Attrs):
|
|
124
131
|
self.entity = entity
|
125
132
|
self.query_generator = public.QueryGenerator()
|
126
133
|
super().__init__(dict(attrs))
|
127
|
-
|
134
|
+
|
135
|
+
if "spec" in self._attrs:
|
136
|
+
if isinstance(self._attrs["spec"], str):
|
137
|
+
self._attrs["spec"] = json.loads(self._attrs["spec"])
|
138
|
+
else:
|
139
|
+
self._attrs["spec"] = {}
|
140
|
+
|
141
|
+
@property
|
142
|
+
def spec(self):
|
143
|
+
return self._attrs["spec"]
|
128
144
|
|
129
145
|
@property
|
130
146
|
def sections(self):
|
@@ -153,12 +169,44 @@ class BetaReport(Attrs):
|
|
153
169
|
per_page=per_page,
|
154
170
|
)
|
155
171
|
|
172
|
+
@property
|
173
|
+
def id(self):
|
174
|
+
return self._attrs.get("id")
|
175
|
+
|
176
|
+
@property
|
177
|
+
def name(self):
|
178
|
+
return self._attrs.get("name")
|
179
|
+
|
180
|
+
@property
|
181
|
+
def display_name(self):
|
182
|
+
return self._attrs.get("displayName")
|
183
|
+
|
184
|
+
@property
|
185
|
+
def description(self):
|
186
|
+
return self._attrs.get("description")
|
187
|
+
|
188
|
+
@property
|
189
|
+
def user(self):
|
190
|
+
return self._attrs.get("user")
|
191
|
+
|
156
192
|
@property
|
157
193
|
def updated_at(self):
|
158
|
-
return self._attrs
|
194
|
+
return self._attrs.get("updatedAt")
|
195
|
+
|
196
|
+
@property
|
197
|
+
def created_at(self):
|
198
|
+
return self._attrs.get("createdAt")
|
159
199
|
|
160
200
|
@property
|
161
201
|
def url(self):
|
202
|
+
if (
|
203
|
+
not self.client
|
204
|
+
or not self.entity
|
205
|
+
or not self.project
|
206
|
+
or not self.display_name
|
207
|
+
or not self.id
|
208
|
+
):
|
209
|
+
return None
|
162
210
|
return self.client.app_url + "/".join(
|
163
211
|
[
|
164
212
|
self.entity,
|
@@ -166,7 +214,12 @@ class BetaReport(Attrs):
|
|
166
214
|
"reports",
|
167
215
|
"--".join(
|
168
216
|
[
|
169
|
-
|
217
|
+
# made this more closely match the url creation in the frontend (https://github.com/wandb/core/blob/76943979c8e967f7a62dae8bef0a001a2672584c/frontends/app/src/util/report/urls.ts#L19)
|
218
|
+
urllib.parse.quote(
|
219
|
+
re.sub(
|
220
|
+
r"-+", "-", re.sub(r"\W", "-", self.display_name)
|
221
|
+
).strip("-")
|
222
|
+
),
|
170
223
|
self.id.replace("=", ""),
|
171
224
|
]
|
172
225
|
),
|
@@ -175,7 +228,10 @@ class BetaReport(Attrs):
|
|
175
228
|
|
176
229
|
def to_html(self, height=1024, hidden=False):
|
177
230
|
"""Generate HTML containing an iframe displaying this report."""
|
178
|
-
url = self.url
|
231
|
+
url = self.url
|
232
|
+
if url is None:
|
233
|
+
return "<div>Report URL not available</div>"
|
234
|
+
url = url + "?jupyter=true"
|
179
235
|
style = f"border:none;width:100%;height:{height}px;"
|
180
236
|
prefix = ""
|
181
237
|
if hidden:
|
wandb/apis/public/runs.py
CHANGED
@@ -111,7 +111,7 @@ class Runs(SizedPaginator["Run"]):
|
|
111
111
|
runs(filters: $filters, after: $cursor, first: $perPage, order: $order) {{
|
112
112
|
edges {{
|
113
113
|
node {{
|
114
|
-
{"" if _server_provides_internal_id_for_project(client) else "
|
114
|
+
{"projectId" if _server_provides_internal_id_for_project(client) else ""}
|
115
115
|
...RunFragment
|
116
116
|
}}
|
117
117
|
cursor
|
@@ -143,11 +143,10 @@ class Runs(SizedPaginator["Run"]):
|
|
143
143
|
super().__init__(client, variables, per_page)
|
144
144
|
|
145
145
|
@property
|
146
|
-
def
|
147
|
-
if self.last_response:
|
148
|
-
|
149
|
-
|
150
|
-
return None
|
146
|
+
def _length(self):
|
147
|
+
if not self.last_response:
|
148
|
+
self._load_page()
|
149
|
+
return self.last_response["project"]["runCount"]
|
151
150
|
|
152
151
|
@property
|
153
152
|
def more(self):
|
@@ -454,25 +453,19 @@ class Run(Attrs):
|
|
454
453
|
)
|
455
454
|
|
456
455
|
def load(self, force=False):
|
457
|
-
|
458
|
-
"""
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
456
|
+
if force or not self._attrs:
|
457
|
+
query = gql(f"""#graphql
|
458
|
+
query Run($project: String!, $entity: String!, $name: String!) {{
|
459
|
+
project(name: $project, entityName: $entity) {{
|
460
|
+
run(name: $name) {{
|
461
|
+
{"projectId" if _server_provides_internal_id_for_project(self.client) else ""}
|
462
|
+
...RunFragment
|
463
|
+
}}
|
464
464
|
}}
|
465
465
|
}}
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
"projectId"
|
470
|
-
if _server_provides_internal_id_for_project(self.client)
|
471
|
-
else "",
|
472
|
-
RUN_FRAGMENT,
|
473
|
-
)
|
474
|
-
)
|
475
|
-
if force or not self._attrs:
|
466
|
+
{RUN_FRAGMENT}
|
467
|
+
""")
|
468
|
+
|
476
469
|
response = self._exec(query)
|
477
470
|
if (
|
478
471
|
response is None
|
wandb/automations/__init__.py
CHANGED
@@ -45,21 +45,21 @@ else:
|
|
45
45
|
|
46
46
|
__all__ = [
|
47
47
|
# Scopes
|
48
|
-
"ScopeType",
|
49
|
-
"ArtifactCollectionScope",
|
50
|
-
"ProjectScope",
|
48
|
+
"ScopeType", # doc:exclude
|
49
|
+
"ArtifactCollectionScope", # doc:exclude
|
50
|
+
"ProjectScope", # doc:exclude
|
51
51
|
# Events
|
52
|
-
"EventType",
|
52
|
+
"EventType", # doc:exclude
|
53
53
|
"OnAddArtifactAlias",
|
54
54
|
"OnCreateArtifact",
|
55
55
|
"OnLinkArtifact",
|
56
56
|
"OnRunMetric",
|
57
|
-
"ArtifactEvent",
|
58
|
-
"RunEvent",
|
57
|
+
"ArtifactEvent", # doc:exclude
|
58
|
+
"RunEvent", # doc:exclude
|
59
59
|
"MetricThresholdFilter",
|
60
60
|
"MetricChangeFilter",
|
61
61
|
# Actions
|
62
|
-
"ActionType",
|
62
|
+
"ActionType", # doc:exclude
|
63
63
|
"SendNotification",
|
64
64
|
"SendWebhook",
|
65
65
|
"DoNothing",
|
@@ -67,7 +67,7 @@ __all__ = [
|
|
67
67
|
"Automation",
|
68
68
|
"NewAutomation",
|
69
69
|
# Integrations
|
70
|
-
"Integration",
|
71
|
-
"SlackIntegration",
|
72
|
-
"WebhookIntegration",
|
70
|
+
"Integration", # doc:exclude
|
71
|
+
"SlackIntegration", # doc:exclude
|
72
|
+
"WebhookIntegration", # doc:exclude
|
73
73
|
]
|
wandb/automations/_utils.py
CHANGED
wandb/automations/actions.py
CHANGED
wandb/automations/automations.py
CHANGED
wandb/automations/events.py
CHANGED
wandb/bin/gpu_stats
CHANGED
Binary file
|
wandb/bin/wandb-core
CHANGED
Binary file
|
wandb/cli/beta.py
CHANGED
@@ -11,7 +11,7 @@ import sys
|
|
11
11
|
import click
|
12
12
|
|
13
13
|
import wandb
|
14
|
-
from wandb.errors import
|
14
|
+
from wandb.errors import WandbCoreNotAvailableError
|
15
15
|
from wandb.sdk.wandb_sync import _sync
|
16
16
|
from wandb.util import get_core_path
|
17
17
|
|
@@ -24,12 +24,6 @@ def beta():
|
|
24
24
|
|
25
25
|
wandb._sentry.configure_scope(process_context="wandb_beta")
|
26
26
|
|
27
|
-
if wandb.env.is_require_legacy_service():
|
28
|
-
raise UsageError(
|
29
|
-
"wandb beta commands can only be used with wandb-core. "
|
30
|
-
f"Please make sure that `{wandb.env._REQUIRE_LEGACY_SERVICE}` is not set."
|
31
|
-
)
|
32
|
-
|
33
27
|
try:
|
34
28
|
get_core_path()
|
35
29
|
except WandbCoreNotAvailableError as e:
|
wandb/cli/cli.py
CHANGED
@@ -252,36 +252,6 @@ def login(key, host, cloud, relogin, anonymously, verify, no_offline=False):
|
|
252
252
|
)
|
253
253
|
|
254
254
|
|
255
|
-
@cli.command(
|
256
|
-
context_settings=CONTEXT, help="Run a wandb service", name="service", hidden=True
|
257
|
-
)
|
258
|
-
@click.option(
|
259
|
-
"--sock-port", default=None, type=int, help="The host port to bind socket service."
|
260
|
-
)
|
261
|
-
@click.option("--port-filename", default=None, help="Save allocated port to file.")
|
262
|
-
@click.option("--address", default=None, help="The address to bind service.")
|
263
|
-
@click.option("--pid", default=None, type=int, help="The parent process id to monitor.")
|
264
|
-
@click.option("--debug", is_flag=True, help="log debug info")
|
265
|
-
@display_error
|
266
|
-
def service(
|
267
|
-
sock_port=None,
|
268
|
-
port_filename=None,
|
269
|
-
address=None,
|
270
|
-
pid=None,
|
271
|
-
debug=False,
|
272
|
-
):
|
273
|
-
from wandb.sdk.service.server import WandbServer
|
274
|
-
|
275
|
-
server = WandbServer(
|
276
|
-
sock_port=sock_port,
|
277
|
-
port_fname=port_filename,
|
278
|
-
address=address,
|
279
|
-
pid=pid,
|
280
|
-
debug=debug,
|
281
|
-
)
|
282
|
-
server.serve()
|
283
|
-
|
284
|
-
|
285
255
|
@cli.command(
|
286
256
|
context_settings=CONTEXT, help="Configure a directory with Weights & Biases"
|
287
257
|
)
|
wandb/env.py
CHANGED
@@ -86,7 +86,6 @@ _EXECUTABLE = "WANDB_X_EXECUTABLE"
|
|
86
86
|
LAUNCH_QUEUE_NAME = "WANDB_LAUNCH_QUEUE_NAME"
|
87
87
|
LAUNCH_QUEUE_ENTITY = "WANDB_LAUNCH_QUEUE_ENTITY"
|
88
88
|
LAUNCH_TRACE_ID = "WANDB_LAUNCH_TRACE_ID"
|
89
|
-
_REQUIRE_LEGACY_SERVICE = "WANDB_X_REQUIRE_LEGACY_SERVICE"
|
90
89
|
ENABLE_DCGM_PROFILING = "WANDB_ENABLE_DCGM_PROFILING"
|
91
90
|
|
92
91
|
# For testing, to be removed in future version
|
@@ -150,11 +149,6 @@ def _env_as_bool(
|
|
150
149
|
return False
|
151
150
|
|
152
151
|
|
153
|
-
def is_require_legacy_service(env: MutableMapping | None = None) -> bool:
|
154
|
-
"""Return whether wandb.require("legacy-service") was used."""
|
155
|
-
return _env_as_bool(_REQUIRE_LEGACY_SERVICE, default="False", env=env)
|
156
|
-
|
157
|
-
|
158
152
|
def is_debug(default: str | None = None, env: MutableMapping | None = None) -> bool:
|
159
153
|
return _env_as_bool(DEBUG, default=default, env=env)
|
160
154
|
|
@@ -22,7 +22,9 @@ class WandbCallback:
|
|
22
22
|
|
23
23
|
Example:
|
24
24
|
```
|
25
|
-
train_pool = Pool(
|
25
|
+
train_pool = Pool(
|
26
|
+
train[features], label=train["label"], cat_features=cat_features
|
27
|
+
)
|
26
28
|
test_pool = Pool(test[features], label=test["label"], cat_features=cat_features)
|
27
29
|
|
28
30
|
model = CatBoostRegressor(
|
@@ -130,7 +132,9 @@ def log_summary(
|
|
130
132
|
|
131
133
|
Example:
|
132
134
|
```python
|
133
|
-
train_pool = Pool(
|
135
|
+
train_pool = Pool(
|
136
|
+
train[features], label=train["label"], cat_features=cat_features
|
137
|
+
)
|
134
138
|
test_pool = Pool(test[features], label=test["label"], cat_features=cat_features)
|
135
139
|
|
136
140
|
model = CatBoostRegressor(
|
@@ -270,7 +270,9 @@ def create_component_from_func(
|
|
270
270
|
Example of a component function declaring file input and output::
|
271
271
|
|
272
272
|
def catboost_train_classifier(
|
273
|
-
training_data_path: InputPath(
|
273
|
+
training_data_path: InputPath(
|
274
|
+
"CSV"
|
275
|
+
), # Path to input data file of type "CSV"
|
274
276
|
trained_model_path: OutputPath(
|
275
277
|
"CatBoostModel"
|
276
278
|
), # Path to output data file of type "CatBoostModel"
|
wandb/integration/sb3/sb3.py
CHANGED
@@ -106,9 +106,9 @@ class WandbCallback(BaseCallback):
|
|
106
106
|
os.makedirs(self.model_save_path, exist_ok=True)
|
107
107
|
self.path = os.path.join(self.model_save_path, "model.zip")
|
108
108
|
else:
|
109
|
-
assert (
|
110
|
-
|
111
|
-
)
|
109
|
+
assert self.model_save_freq == 0, (
|
110
|
+
"to use the `model_save_freq` you have to set the `model_save_path` parameter"
|
111
|
+
)
|
112
112
|
|
113
113
|
def _init_callback(self) -> None:
|
114
114
|
d = {}
|
@@ -102,7 +102,9 @@ class WandBUltralyticsCallback:
|
|
102
102
|
model = YOLO("yolov8n.pt")
|
103
103
|
|
104
104
|
# add wandb callback
|
105
|
-
add_wandb_callback(
|
105
|
+
add_wandb_callback(
|
106
|
+
model, max_validation_batches=2, enable_model_checkpointing=True
|
107
|
+
)
|
106
108
|
|
107
109
|
# train
|
108
110
|
model.train(data="coco128.yaml", epochs=5, imgsz=640)
|
@@ -454,7 +456,9 @@ def add_wandb_callback(
|
|
454
456
|
model = YOLO("yolov8n.pt")
|
455
457
|
|
456
458
|
# add wandb callback
|
457
|
-
add_wandb_callback(
|
459
|
+
add_wandb_callback(
|
460
|
+
model, max_validation_batches=2, enable_model_checkpointing=True
|
461
|
+
)
|
458
462
|
|
459
463
|
# train
|
460
464
|
model.train(data="coco128.yaml", epochs=5, imgsz=640)
|
wandb/plot/__init__.py
CHANGED
wandb/plot/bar.py
CHANGED
@@ -19,11 +19,11 @@ def bar(
|
|
19
19
|
"""Constructs a bar chart from a wandb.Table of data.
|
20
20
|
|
21
21
|
Args:
|
22
|
-
table
|
23
|
-
label
|
24
|
-
value
|
25
|
-
title
|
26
|
-
split_table
|
22
|
+
table: A table containing the data for the bar chart.
|
23
|
+
label: The name of the column to use for the labels of each bar.
|
24
|
+
value: The name of the column to use for the values of each bar.
|
25
|
+
title: The title of the bar chart.
|
26
|
+
split_table: Whether the table should be split into a separate section
|
27
27
|
in the W&B UI. If `True`, the table will be displayed in a section named
|
28
28
|
"Custom Chart Tables". Default is `False`.
|
29
29
|
|
@@ -32,34 +32,35 @@ def bar(
|
|
32
32
|
chart, pass it to `wandb.log()`.
|
33
33
|
|
34
34
|
Example:
|
35
|
-
```
|
36
|
-
import random
|
37
|
-
import wandb
|
38
35
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
]
|
36
|
+
```python
|
37
|
+
import random
|
38
|
+
import wandb
|
39
|
+
|
40
|
+
# Generate random data for the table
|
41
|
+
data = [
|
42
|
+
["car", random.uniform(0, 1)],
|
43
|
+
["bus", random.uniform(0, 1)],
|
44
|
+
["road", random.uniform(0, 1)],
|
45
|
+
["person", random.uniform(0, 1)],
|
46
|
+
]
|
46
47
|
|
47
|
-
|
48
|
-
|
48
|
+
# Create a table with the data
|
49
|
+
table = wandb.Table(data=data, columns=["class", "accuracy"])
|
49
50
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
51
|
+
# Initialize a W&B run and log the bar plot
|
52
|
+
with wandb.init(project="bar_chart") as run:
|
53
|
+
# Create a bar plot from the table
|
54
|
+
bar_plot = wandb.plot.bar(
|
55
|
+
table=table,
|
56
|
+
label="class",
|
57
|
+
value="accuracy",
|
58
|
+
title="Object Classification Accuracy",
|
59
|
+
)
|
59
60
|
|
60
|
-
|
61
|
-
|
62
|
-
|
61
|
+
# Log the bar chart to W&B
|
62
|
+
run.log({"bar_plot": bar_plot})
|
63
|
+
```
|
63
64
|
"""
|
64
65
|
return plot_table(
|
65
66
|
data_table=table,
|