Closed mayurgd closed 2 years ago
Hey @mayura64! The dictionaries that are printed should never be there, that's a bug in a dependency. Thanks for finding that, it's resolved now :)
As far as the PyCave logs are concerned (Running initialization...
and Fitting K-Means...
), you can turn them off easily by adding the following:
import logging
from pycave import set_logging_level
set_logging_level(logging.WARNING)
The logs that are printed have level logging.INFO
. I'll close this as soon as I published a new PyCave version which fixes the dependency.
Note that set_logging_level(logging.WARNING)
also turns off the progress bar and the model summary automatically so you don't have to set these flags explicitly.
Is this part somewhere in the documentation? Didnt find it and used up too much time to find out how to suppress the outputs. The solution also does not suppress the "PossibleUserWarning" if you dont want to use the CPU.
This is my solution now:
import pycave
from pycave import set_logging_level
import torch
pycave.set_logging_level(logging.WARNING)
gmm = pycave.bayes.GaussianMixture(num_components=2)
with warnings.catch_warnings():
warnings.simplefilter("ignore")
gmm.fit(torch.randn(100, 2).float())
I have disabled progress bar using enable_progress_bar=0, but not able to find the correct parameter that will disable the internal model output printing. Just want to disable those coz I will be running it a lot of times, and don't want the output console to be printed with all the models internal outputs
Current Output:
Expected Output: