comet-ml / issue-tracking

Questions, Help, and Issues for Comet ML
https://www.comet.ml
85 stars 7 forks source link

Failed to setup the std logger (Python 3.8.5) #384

Closed khirotaka closed 1 year ago

khirotaka commented 4 years ago

Dear comet-ml team.

I got

COMET ERROR: Failed to setup the std logger

when using comet.ml with Python 3.8.

Also, if I ran the code using tqdm.auto.tqdm, I got

 /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ multiprocessing/resource_tracker.py:216: UserWarning: resource_tracker: There appears to be 2 leaked semaphore objects to clean up at shutdown
  warnings.warn('resource_tracker: There appear to be %d '

And I also checked on the website and found that three logs were taken per experiment, as shown in the screenshot below.

comet web page

Expected behavior

  1. record the results of one experiment per experiment.
  2. display a summary at the end of the experiment

Environment

Error messages, stack traces, or logs

user@user$ python test_code.py
COMET ERROR: Failed to setup the std logger
COMET INFO: Experiment is live on comet.ml https://www.comet.ml/XXXXXXXXXXXXX

COMET INFO: Uploading stats to Comet before program termination (may take several seconds)
user@user$ /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/resource_tracker.py:216: UserWarning: resource_tracker: There appear to be 2 leaked semaphore objects to clean up at shutdown
  warnings.warn('resource_tracker: There appear to be %d '

Reproducible examples (optional)

# test_code.py
from comet_ml import Experiment
from tqdm.auto import tqdm
import torch
import torch.nn as nn
import torch.optim as optim

experiment = Experiment(project_name="test_code")

model = nn.Linear(5, 5)
optimizer = optim.Adam(model.parameters())
criterion = nn.CrossEntropyLoss()

data = torch.randn(512, 5)
targets = torch.randint(5, size=(512, ))

for epoch in tqdm(range(100)):
    optimizer.zero_grad()
    out = model(data)
    loss = criterion(out, targets)
    loss.backward()
    optimizer.step()

Additional context (optional)

There was no problem with Python 3.7.9.

dsblank commented 4 years ago

@khirotaka Thanks for the report and reproducible example. We're looking into this.

dsblank commented 3 years ago

Due to issues with the default native output logger with Python 3.8 and MacOS, we've set the default to be "simple" for now. See: https://www.comet.ml/docs/python-sdk/releases/#release-3212

We are continuing to look for a better solution.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 1 year ago

This issue was closed because it has been stalled for 5 days with no activity.