CycleGANを触ってみる

$ git clone https://github.com/xhujoy/CycleGAN-tensorflow
$ cd CycleGAN-tensorflow

$ sudo apt update
$ sudo apt install python3-dev python3-pip python3-venv
$ python3 -m venv –system-site-packages ./venv
$ source ./venv/bin/activate
$ pip3 –no-cache-dir install –upgrade tensorflow
pkg_resources.ContextualVersionConflict: (pyparsing 3.0.6 (/home/vagrant/.local/lib/python3.8/site-packages), Requirement.parse(‘pyparsing<3,>=2.0.2′), {‘packaging’})
—————————————-
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

ありゃ…

$ pip3 uninstall pyparsing
$ pip3 install pyparsing==”2.4.7″
$ pip3 –no-cache-dir install –upgrade tensorflow
$ python3 -c “import tensorflow as tf;print(tf.reduce_sum(tf.random.normal([1000, 1000])))”

$ bash ./download_dataset.sh horse2zebra
$ python3 main.py –dataset_dir=horse2zebra
2021-12-05 01:57:16.540649: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library ‘libcudart.so.11.0’; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory
2021-12-05 01:57:16.541206: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
Traceback (most recent call last):
File “main.py”, line 4, in
tf.set_random_seed(19)
AttributeError: module ‘tensorflow’ has no attribute ‘set_random_seed’

どうやらtensor-flow 2系には対応していないみたい…

$ cd ..
$ git clone https://github.com/LynnHo/CycleGAN-Tensorflow-2.git
$ cd CycleGAN-Tensorflow-2
$ bash ./download_dataset.sh horse2zebra
$ pip3 install tensorflow-addons
$ pip3 install tqdm
$ pip3 install oyaml
$ python3 train.py –dataset horse2zebra
$ python3 test.py –experiment_dir ./output/horse2zebra
terminate called after throwing an instance of ‘std::bad_alloc’
what(): std::bad_alloc
Aborted (core dumped)

ああああああああああん
上手く行かんな