RameenAbdal / StyleFlow

StyleFlow: Attribute-conditioned Exploration of StyleGAN-generated Images using Conditional Continuous Normalizing Flows (ACM TOG 2021)
http://rameenabdal.github.io/StyleFlow
2.43k stars 344 forks source link

Can not run it on Windows 10 #80

Open FlowDownTheRiver opened 3 years ago

FlowDownTheRiver commented 3 years ago

I have tried to run this for almost 5 hours.I am about to give up.Any help on this?

(styleflow) C:\StyleFlow>python main.py ----------------- Options --------------- batchSize: 1 checkpoints_dir: ./checkpoints dataroot: ./data/datasetX gpu_ids: 0 max_result_snapshots: 30 model: xxxx name: XXXX network_pkl: gdrive:networks/stylegan2-ffhq-config-f.pkl only_for_test: ... phase: test ----------------- End ------------------- Loading networks from "gdrive:networks/stylegan2-ffhq-config-f.pkl"... Setting up TensorFlow plugin "fused_bias_act.cu": Preprocessing... Failed! Traceback (most recent call last): File "main.py", line 365, in ex = ExWindow(opt) File "main.py", line 40, in init self.EX = Ex(opt) File "main.py", line 70, in init self.init_deep_model(opt) File "main.py", line 105, in init_deep_model self.model = Build_model(self.opt) File "C:\StyleFlow\utils.py", line 200, in init _G, _D, Gs = pretrained_networks.load_networks(network_pkl) File "C:\StyleFlow\pretrained_networks.py", line 76, in load_networks G, D, Gs = pickle.load(stream, encoding='latin1') File "C:\StyleFlow\dnnlib\tflib\network.py", line 297, in setstate self._init_graph() File "C:\StyleFlow\dnnlib\tflib\network.py", line 154, in _init_graph out_expr = self._build_func(*self.input_templates, **build_kwargs) File "", line 491, in G_synthesis_stylegan2 File "", line 455, in layer File "", line 99, in modulated_conv2d_layer File "", line 68, in apply_bias_act File "C:\StyleFlow\dnnlib\tflib\ops\fused_bias_act.py", line 68, in fused_bias_act return impl_dict[impl](x=x, b=b, axis=axis, act=act, alpha=alpha, gain=gain) File "C:\StyleFlow\dnnlib\tflib\ops\fused_bias_act.py", line 122, in _fused_bias_act_cuda cuda_kernel = _get_plugin().fused_bias_act File "C:\StyleFlow\dnnlib\tflib\ops\fused_bias_act.py", line 16, in _get_plugin return custom_ops.get_plugin(os.path.splitext(file)[0] + '.cu') File "C:\StyleFlow\dnnlib\tflib\custom_ops.py", line 118, in get_plugin _run_cmd(_prepare_nvcc_cli('"%s" --preprocess -o "%s" --keep --keep-dir "%s"' % (cuda_file, tmp_file, tmp_dir))) File "C:\StyleFlow\dnnlib\tflib\custom_ops.py", line 63, in _run_cmd output = pipe.read() File "C:\Users\Username\anaconda3\envs\styleflow\lib\encodings\cp1254.py", line 23, in decode return codecs.charmap_decode(input,self.errors,decoding_table)[0] UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d in position 28: character maps to

justinjohn0306 commented 3 years ago

try my PR repo: https://github.com/justinjohn0306/StyleFlow-Windows-10

elTRexx commented 3 years ago

Hi, I'd like to share my experience for making it work (at least the UI launch so far) on Windows 10. @justinjohn0306 repo helped me as I used 2 of his file for this.

So if i remember (sorry didn't write my step, I tell from head)

1) You need anaconda for windows : https://www.anaconda.com/products/individual

2) Launch Anaconda PowerShell Prompt (a shortcut is create when installing, if you don't find it, here is mine for example %windir%\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy ByPass -NoExit -Command "& 'E:\IA\anaconda3\shell\condabin\conda-hook.ps1' ; conda activate 'E:\IA\anaconda3' ", with E:\IA\ is where I installed Anaconda on step 1) ) 3) from anaconda prompt (you should see something like(base) PS C:\Users\[your_username]>) type : cd [wherever you clone styleflow git] You should see something like : (base) PS [whereever you clone styleflow git] (for me for example : (base) PS E:\IA\StyleFlow>)

4) before running conda create env, you have to get 2 files from @justinjohn0306 repo : https://github.com/justinjohn0306/StyleFlow-Windows-10/blob/master/env_windows.yml and https://github.com/justinjohn0306/StyleFlow-Windows-10/blob/master/dnnlib/tflib/custom_ops.py and copy paste them on you StyleFlow git clone (replace custom_ops.py with new, you can make a bakeup if you want)

5) I had other issue myself involving modifing this 2 files even more :

6) Now you can get back to you conda PS prompt and type conda env create -f env_windows.yml

7) when finished swith to the new env create : conda activate styleflow

Or any other response.py file that the prompt will yell at you.

8) Now like @justinjohn0306 explain on his repo type conda install pytorch==1.2.0 torchvision==0.4.0 cudatoolkit=10.0 -c pytorch

9) Finally run python main.py

Sorry for this out of my head, and not a precise guide, but I hope it may help some of you after having myself stuck on this last days.

leeisack commented 3 years ago

내 PR 리포지토리 시도: https://github.com/justinjohn0306/StyleFlow-Windows-10

I took a good look at your repo. However, I do not understand the docker part while following the installation. It would be of great help if you explain how to install nvidia-docker2 on Windows. Thank you.

675492062 commented 2 years ago

“Installation (Docker)” is another way of installation??? or it is necessary.