Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
shivamshrirao
GitHub Repository: shivamshrirao/diffusers
Path: blob/main/utils/print_env.py
1440 views
1
#!/usr/bin/env python3
2
3
# coding=utf-8
4
# Copyright 2023 The HuggingFace Inc. team.
5
#
6
# Licensed under the Apache License, Version 2.0 (the "License");
7
# you may not use this file except in compliance with the License.
8
# You may obtain a copy of the License at
9
#
10
# http://www.apache.org/licenses/LICENSE-2.0
11
#
12
# Unless required by applicable law or agreed to in writing, software
13
# distributed under the License is distributed on an "AS IS" BASIS,
14
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
# See the License for the specific language governing permissions and
16
# limitations under the License.
17
18
# this script dumps information about the environment
19
20
import os
21
import platform
22
import sys
23
24
25
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3"
26
27
print("Python version:", sys.version)
28
29
print("OS platform:", platform.platform())
30
print("OS architecture:", platform.machine())
31
32
try:
33
import torch
34
35
print("Torch version:", torch.__version__)
36
print("Cuda available:", torch.cuda.is_available())
37
print("Cuda version:", torch.version.cuda)
38
print("CuDNN version:", torch.backends.cudnn.version())
39
print("Number of GPUs available:", torch.cuda.device_count())
40
except ImportError:
41
print("Torch version:", None)
42
43
try:
44
import transformers
45
46
print("transformers version:", transformers.__version__)
47
except ImportError:
48
print("transformers version:", None)
49
50