afruehstueck / tileGAN

Code for TileGAN: Synthesis of Large-Scale Non-Homogeneous Textures (SIGGRAPH 2019)
GNU General Public License v3.0
222 stars 19 forks source link

server compile issue #4

Closed powerspowers closed 4 years ago

powerspowers commented 4 years ago

When I attempted to run setup.py the pybind11 includes could not be found nor could the hnswlib include.

The latter was solved by adding "..\" to go up a directory.

For pybind11 I added absolute directories to find them in my sitepackages directory. I imagine I could have added a path but I did not know exactly which PATH to add.

include "C:\Users\Myname\AppData\Roaming\Python\Python37\Include\pybind11\pybind11.h"

include "C:\Users\Myname\AppData\Roaming\Python\Python37\Include\pybind11\numpy.h"

include "C:\Users\Myname\AppData\Roaming\Python\Python37\Include\pybind11\stl.h"

include "..\hnswlib\hnswlib.h"

ddesmond commented 4 years ago

hey, had simialir issues on wins, did you tried https://github.com/nmslib/hnswlib ?

powerspowers commented 4 years ago

my changes above seem to work but now I am wrestling with Cuda 10.2 not working well with Tensorflow … need to revert back to 10.1

afruehstueck commented 4 years ago

@powerspowers have you tried to install pybind11 in a clean conda environment using pip? hsnwlib suggests you can install like this:

apt-get install -y python-setuptools python-pip
pip install pybind11 numpy setuptools
cd python_bindings
python setup.py install

CUDA and Tensorflow are definitely tough to get to run. I run TileGAN using CUDA 9.0, cuDNN 7.1.2 and Tensorflow 1.8.

powerspowers commented 4 years ago

I did set it up in a conda env. Once I sort out tensorflow/cuda I can see if it runs. If I fail with latest Tensorflow and CUDA 10.1 I'll drop back to Tensorflow 1.8 and CUDA 9.0

powerspowers commented 4 years ago

I was able to downgrade to 10.1 using:

conda uninstall cudatoolkit conda install cudatoolkit=10.1 -c pytorch

The correct cuda DLL was found, the data directory was found for [Seurat] but when the session was created this error happening:

D:\TileGAN>python tileGAN_server.py 2020-02-09 21:31:44.861498: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_101.dll datasets found in data directory: ['seurat'] Creating session and loading graph for stage A... Traceback (most recent call last): File "tileGAN_server.py", line 1231, in manager = TFManager() File "tileGAN_server.py", line 87, in init self.initDataset(availDatasets[0]) File "tileGAN_server.py", line 112, in initDataset self.initNetworks() File "tileGAN_server.py", line 222, in initNetworks self.sessionA = tf.Session() AttributeError: module 'tensorflow' has no attribute 'Session'

Is this a change to the Session attribute in the latest Tensorflow version? If so I may revert my Tensorflow version or may attempt to update the Session call(s).

powerspowers commented 4 years ago

Got my answer doing a TF forum search which revealed that TF 2.0 made a change:

If you still want to use tf.Session(), use the syntax tf.compat.v1.Session() instead.

I'll modify the Session call(s) and give it a whirl.

powerspowers commented 4 years ago

Can revert to v1 behavior by doing the following:

import tensorflow.compat.v1 as tf tf.disable_v2_behavior()

Now having an issue with init_graph trying to access get_variable and failing. Traceback (most recent call last): File "tileGAN_server.py", line 1234, in manager = TFManager() File "tileGAN_server.py", line 90, in init self.initDataset(availDatasets[0]) File "tileGAN_server.py", line 115, in initDataset self.initNetworks() File "tileGAN_server.py", line 230, in initNetworks Gs = pickle.load(file) File "D:\TileGAN\tfutil.py", line 577, in setstate self._init_graph() File "D:\TileGAN\tfutil.py", line 482, in _init_graph out_expr = self._build_func(*self.input_templates, is_template_graph=True, **self.static_kwargs) File "", line 236, in G_paper AttributeError: module 'tensorflow' has no attribute 'get_variable'

powerspowers commented 4 years ago

Going to close this issue. Someone running on Windows 10 can make the include changes I did and get the .h files to load correctly. Going to open a new issue about TF 2.0 issues as I seek to get this running on the latest version.