Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update code for new version of python #333

Open
LT1st opened this issue Feb 24, 2024 · 0 comments
Open

Update code for new version of python #333

LT1st opened this issue Feb 24, 2024 · 0 comments

Comments

@LT1st
Copy link

LT1st commented Feb 24, 2024

windows with python 3.9 faced problems:

(cu118) PS D:\0code\pix2pixHD> conda list
# packages in environment at C:\Users\lutao\.conda\envs\cu118:
#
# Name                    Version                   Build  Channel
blas                      1.0                         mkl    defaults
brotli-python             1.0.9            py39hd77b12b_7    defaults
ca-certificates           2023.12.12           haa95532_0    defaults
certifi                   2024.2.2         py39haa95532_0    defaults
charset-normalizer        2.0.4              pyhd3eb1b0_0    defaults
cuda-cccl                 12.3.101                      0    nvidia
cuda-cudart               11.8.89                       0    nvidia
cuda-cudart-dev           11.8.89                       0    nvidia
cuda-cupti                11.8.87                       0    nvidia
cuda-libraries            11.8.0                        0    nvidia
cuda-libraries-dev        11.8.0                        0    nvidia
cuda-nvrtc                11.8.89                       0    nvidia
cuda-nvrtc-dev            11.8.89                       0    nvidia
cuda-nvtx                 11.8.86                       0    nvidia
cuda-profiler-api         12.3.101                      0    nvidia
cuda-runtime              11.8.0                        0    nvidia
dominate                  2.9.1                    pypi_0    pypi
filelock                  3.13.1           py39haa95532_0    defaults
freetype                  2.12.1               ha860e81_0    defaults
gmpy2                     2.1.2            py39h7f96b67_0    defaults
idna                      3.4              py39haa95532_0    defaults
intel-openmp              2023.1.0         h59b6b97_46320    defaults
jinja2                    3.1.3            py39haa95532_0    defaults
jpeg                      9e                   h2bbff1b_1    defaults
lerc                      3.0                  hd77b12b_0    defaults
libcublas                 11.11.3.6                     0    nvidia
libcublas-dev             11.11.3.6                     0    nvidia
libcufft                  10.9.0.58                     0    nvidia
libcufft-dev              10.9.0.58                     0    nvidia
libcurand                 10.3.4.107                    0    nvidia
libcurand-dev             10.3.4.107                    0    nvidia
libcusolver               11.4.1.48                     0    nvidia
libcusolver-dev           11.4.1.48                     0    nvidia
libcusparse               11.7.5.86                     0    nvidia
libcusparse-dev           11.7.5.86                     0    nvidia
libdeflate                1.17                 h2bbff1b_1    defaults
libjpeg-turbo             2.0.0                h196d8e1_0    defaults
libnpp                    11.8.0.86                     0    nvidia
libnpp-dev                11.8.0.86                     0    nvidia
libnvjpeg                 11.9.0.86                     0    nvidia
libnvjpeg-dev             11.9.0.86                     0    nvidia
libpng                    1.6.39               h8cc25b3_0    defaults
libtiff                   4.5.1                hd77b12b_0    defaults
libuv                     1.44.2               h2bbff1b_0    defaults
libwebp-base              1.3.2                h2bbff1b_0    defaults
lz4-c                     1.9.4                h2bbff1b_0    defaults
markupsafe                2.1.3            py39h2bbff1b_0    defaults
mkl                       2023.1.0         h6b88ed4_46358    defaults
mkl-service               2.4.0            py39h2bbff1b_1    defaults
mkl_fft                   1.3.8            py39h2bbff1b_0    defaults
mkl_random                1.2.4            py39h59b6b97_0    defaults
mpc                       1.1.0                h7edee0f_1    defaults
mpfr                      4.0.2                h62dcd97_1    defaults
mpir                      3.0.0                hec2e145_1    defaults
mpmath                    1.3.0            py39haa95532_0    defaults
networkx                  3.1              py39haa95532_0    defaults
numpy                     1.26.3           py39h055cbcc_0    defaults
numpy-base                1.26.3           py39h65a83cf_0    defaults
openjpeg                  2.4.0                h4fc8c34_0    defaults
openssl                   3.0.13               h2bbff1b_0    defaults
pillow                    10.2.0           py39h2bbff1b_0    defaults
pip                       23.3.1           py39haa95532_0    defaults
pyproject                 1.3.1                    pypi_0    pypi
pysocks                   1.7.1            py39haa95532_0    defaults
python                    3.9.18               h1aa4202_0    defaults
pytorch                   2.1.2           py3.9_cuda11.8_cudnn8_0    pytorch
pytorch-cuda              11.8                 h24eeafa_5    pytorch
pytorch-mutex             1.0                        cuda    pytorch
pyyaml                    6.0.1            py39h2bbff1b_0    defaults
requests                  2.31.0           py39haa95532_1    defaults
scipy                     1.12.0                   pypi_0    pypi
setuptools                68.2.2           py39haa95532_0    defaults
sqlite                    3.41.2               h2bbff1b_0    defaults
sympy                     1.12             py39haa95532_0    defaults
tbb                       2021.8.0             h59b6b97_0    defaults
torchvision               0.16.2                   pypi_0    pypi
typing_extensions         4.9.0            py39haa95532_1    defaults
tzdata                    2023d                h04d1e81_0    defaults
urllib3                   2.1.0            py39haa95532_1    defaults
vc                        14.2                 h21ff451_1    defaults
vs2015_runtime            14.27.29016          h5e58377_2    defaults
wheel                     0.41.2           py39haa95532_0    defaults
win_inet_pton             1.1.0            py39haa95532_0    defaults
xz                        5.4.5                h8cc25b3_0    defaults
yaml                      0.2.5                he774522_0    defaults
zlib                      1.2.13               h8cc25b3_0    defaults
zstd                      1.5.5                hd43e919_0    defaults

Problem 1:

train.py, line 9 should be modified in python 3.9

import math
def lcm(a,b): return abs(a * b)/math.gcd(a,b) if a and b else 0

Problem 2:

raise RuntimeError('''
RuntimeError:
        An attempt has been made to start a new process before the
        current process has finished its bootstrapping phase.

        This probably means that you are not using fork to start your
        child processes and you have forgotten to use the proper idiom
        in the main module:

            if __name__ == '__main__':
                freeze_support()
                ...

        The "freeze_support()" line can be omitted if the program
        is not going to be frozen to produce an executable.

add these code in train.py

import multiprocessing
if __name__ == '__main__':
    multiprocessing.freeze_support()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant