Commit 57007a97 authored by Gustaf Ahdritz's avatar Gustaf Ahdritz
Browse files

Make DLLogger less mandatory

parent 7ad80589
...@@ -11,17 +11,21 @@ ...@@ -11,17 +11,21 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import os import os
import operator import operator
import time import time
import dllogger as logger
import numpy as np import numpy as np
import torch.cuda.profiler as profiler import torch.cuda.profiler as profiler
from dllogger import JSONStreamBackend, StdOutBackend, Verbosity
from pytorch_lightning import Callback from pytorch_lightning import Callback
# We make this optional for the Colab's sake
try:
import dllogger as logger
from dllogger import JSONStreamBackend, StdOutBackend, Verbosity
except:
pass
def is_main_process(): def is_main_process():
return int(os.getenv("LOCAL_RANK", "0")) == 0 return int(os.getenv("LOCAL_RANK", "0")) == 0
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment