Isn't working
somera opened this issue · 10 comments
Hi,
it's not working with Python 3.9, 3.8 cause bpy 2.82.1 (Requires: Python >=3.7, <3.8). Than I could import most of the requirements with Python 3.7.9.
But ...
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
pytorch-lightning 1.2.2 requires PyYAML!=5.4.*,>=5.1, but you have pyyaml 5.4 which is incompatible.
Than I installed
pip install PyYAML==5.3.1
But when I try to run it, I get:
python main.py *TODO* --alpha 100 --niter 4000 --nfc 64
Traceback (most recent call last):
File "main.py", line 3, in <module>
from generate_samples import generate_samples
File "D:\projects\github\Mawiszus\World-GAN\generate_samples.py", line 7, in <module>
from config import Config
File "D:\projects\github\Mawiszus\World-GAN\config.py", line 4, in <module>
from typing import List, Literal, Optional, Union
ImportError: cannot import name 'Literal' from 'typing' (C:\Users\rafal\AppData\Local\Programs\Python\Python37\lib\typing.py)
Which Python version is working for this project?
Thx
And if I change the import in config.py to:
from typing import List, Optional, Union
try:
from typing import Literal
except ImportError:
from typing_extensions import Literal
I get:
python main.py *TODO* --alpha 100 --niter 4000 --nfc 64
Traceback (most recent call last):
File "main.py", line 3, in <module>
from generate_samples import generate_samples
File "D:\projects\github\Mawiszus\World-GAN\generate_samples.py", line 7, in <module>
from config import Config
File "D:\projects\github\Mawiszus\World-GAN\config.py", line 14, in <module>
from tap import Tap
File "C:\Users\rafal\AppData\Local\Programs\Python\Python37\lib\site-packages\tap.py", line 6, in <module>
from mc_bin_client import mc_bin_client, memcacheConstants as Constants
File "C:\Users\rafal\AppData\Local\Programs\Python\Python37\lib\site-packages\mc_bin_client\mc_bin_client.py", line 278
except MemcachedError, e:
^
SyntaxError: invalid syntax
this are my first steps in Python. ;)
Than in cpnfig.py I changed the imports to
from typing import List, Optional, Union
try:
from typing import Literal
except ImportError:
from typing_extensions import Literal
And needed
pip install wandb
I think for PyAnvilEditor.
But now I get:
python main.py *TODO* --alpha 100 --niter 4000 --nfc 64
Traceback (most recent call last):
File "main.py", line 84, in <module>
main()
File "main.py", line 36, in main
opt = Config().parse_args()
File "C:\Users\rafal\AppData\Local\Programs\Python\Python37\lib\site-packages\tap\tap.py", line 398, in parse_args
default_namespace = super(Tap, self).parse_args(args)
File "C:\Users\rafal\AppData\Local\Programs\Python\Python37\lib\argparse.py", line 1758, in parse_args
self.error(msg % ' '.join(argv))
File "C:\Users\rafal\AppData\Local\Programs\Python\Python37\lib\argparse.py", line 2506, in error
self.print_usage(_sys.stderr)
File "C:\Users\rafal\AppData\Local\Programs\Python\Python37\lib\argparse.py", line 2476, in print_usage
self._print_message(self.format_usage(), file)
File "C:\Users\rafal\AppData\Local\Programs\Python\Python37\lib\argparse.py", line 2442, in format_usage
return formatter.format_help()
File "C:\Users\rafal\AppData\Local\Programs\Python\Python37\lib\argparse.py", line 284, in format_help
help = self._root_section.format_help()
File "C:\Users\rafal\AppData\Local\Programs\Python\Python37\lib\argparse.py", line 215, in format_help
item_help = join([func(*args) for func, args in self.items])
File "C:\Users\rafal\AppData\Local\Programs\Python\Python37\lib\argparse.py", line 215, in <listcomp>
item_help = join([func(*args) for func, args in self.items])
File "C:\Users\rafal\AppData\Local\Programs\Python\Python37\lib\argparse.py", line 301, in _format_usage
usage = usage % dict(prog=self._prog)
TypeError: unsupported operand type(s) for %: 'bool' and 'dict'
Hi,
thanks for looking into our project! The code is only running in a Python 3.8 environment. You can setup a separate Python environment using Miniconda. Would this be a viable option for you?
Hi, thanks for looking into our project! The code is only running in a Python 3.8 environment. You can setup a separate Python environment using Miniconda. Would this be a viable option for you?
Thx for the response. Cause the project is interesting.
I'm testing it, but ...
D:\projects\github\Mawiszus\World-GAN>pip3 --version
pip 21.1.3 from c:\Users\rafal\miniconda3\lib\site-packages\pip (python 3.8)
D:\projects\github\Mawiszus\World-GAN>pip3 install -r requirements.txt -f "https://download.pytorch.org/whl/torch_stable.html"
Looking in links: https://download.pytorch.org/whl/torch_stable.html
Collecting scipy==1.6.1
Using cached scipy-1.6.1-cp38-cp38-win_amd64.whl (32.7 MB)
Collecting seaborn==0.11.1
Using cached seaborn-0.11.1-py3-none-any.whl (285 kB)
Collecting pandas==1.2.3
Using cached pandas-1.2.3-cp38-cp38-win_amd64.whl (9.3 MB)
Collecting typed_argument_parser==1.6.1
Using cached typed-argument-parser-1.6.1.tar.gz (24 kB)
Collecting tqdm==4.59.0
Using cached tqdm-4.59.0-py2.py3-none-any.whl (74 kB)
Collecting transformers==4.4.2
Using cached transformers-4.4.2-py3-none-any.whl (2.0 MB)
Collecting torch==1.7.1+cu110
Using cached https://download.pytorch.org/whl/cu110/torch-1.7.1%2Bcu110-cp38-cp38-win_amd64.whl (2050.2 MB)
Collecting pytorch_lightning==1.2.2
Using cached pytorch_lightning-1.2.2-py3-none-any.whl (816 kB)
Collecting torchvision==0.8.2+cu110
Using cached https://download.pytorch.org/whl/cu110/torchvision-0.8.2%2Bcu110-cp38-cp38-win_amd64.whl (1.6 MB)
Collecting umap_learn==0.5.1
Using cached umap-learn-0.5.1.tar.gz (80 kB)
Collecting loguru==0.5.3
Using cached loguru-0.5.3-py3-none-any.whl (57 kB)
Collecting matplotlib==3.3.4
Using cached matplotlib-3.3.4-cp38-cp38-win_amd64.whl (8.5 MB)
Collecting fuzzywuzzy==0.18.0
Using cached fuzzywuzzy-0.18.0-py2.py3-none-any.whl (18 kB)
Collecting numpy==1.20.1
Using cached numpy-1.20.1-cp38-cp38-win_amd64.whl (13.7 MB)
ERROR: Could not find a version that satisfies the requirement bpy==2.82.1 (from versions: 0.0.0a0)
ERROR: No matching distribution found for bpy==2.82.1
bpy isn't working with Python 3.8 -> Requires: Python >=3.7, <3.8
Ah, bpy is just an optional dependency. You can remove it from the requirements.txt
file and then it should work!
Ah, bpy is just an optional dependency. You can remove it from the
requirements.txt
file and then it should work!
ok ;) this was my idea too. ;)
but ... I have to import PyYAML==5.3.1 cause
ERROR: Cannot install -r requirements.txt (line 8) and PyYAML==5.4.1 because these package versions have conflicting dependencies.
The conflict is caused by:
The user requested PyYAML==5.4.1
pytorch-lightning 1.2.2 depends on PyYAML!=5.4.* and >=5.1
To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies
wandb was missing too. My requirements.txt
scipy==1.6.1
seaborn==0.11.1
pandas==1.2.3
typed_argument_parser==1.6.1
tqdm==4.59.0
transformers==4.4.2
torch==1.7.1+cu110
pytorch_lightning==1.2.2
torchvision==0.8.2+cu110
umap_learn==0.5.1
loguru==0.5.3
matplotlib==3.3.4
fuzzywuzzy==0.18.0
numpy==1.20.1
python_Levenshtein==0.12.2
PyYAML==5.3.1
scikit_learn==0.24.2
tap==0.2
umap==0.1.1
wandb
And with this Python3 I get same error like with the other Python:
D:\projects\github\Mawiszus\World-GAN>python main.py *TODO* --alpha 100 --niter 4000 --nfc 64
Traceback (most recent call last):
File "main.py", line 84, in <module>
main()
File "main.py", line 36, in main
opt = Config().parse_args()
File "c:\Users\rafal\miniconda3\lib\site-packages\tap\tap.py", line 398, in parse_args
default_namespace = super(Tap, self).parse_args(args)
File "c:\Users\rafal\miniconda3\lib\argparse.py", line 1771, in parse_args
self.error(msg % ' '.join(argv))
File "c:\Users\rafal\miniconda3\lib\argparse.py", line 2519, in error
self.print_usage(_sys.stderr)
File "c:\Users\rafal\miniconda3\lib\argparse.py", line 2489, in print_usage
self._print_message(self.format_usage(), file)
File "c:\Users\rafal\miniconda3\lib\argparse.py", line 2455, in format_usage
return formatter.format_help()
File "c:\Users\rafal\miniconda3\lib\argparse.py", line 282, in format_help
help = self._root_section.format_help()
File "c:\Users\rafal\miniconda3\lib\argparse.py", line 213, in format_help
item_help = join([func(*args) for func, args in self.items])
File "c:\Users\rafal\miniconda3\lib\argparse.py", line 213, in <listcomp>
item_help = join([func(*args) for func, args in self.items])
File "c:\Users\rafal\miniconda3\lib\argparse.py", line 299, in _format_usage
usage = usage % dict(prog=self._prog)
TypeError: unsupported operand type(s) for %: 'bool' and 'dict'
Is *TODO*
your actual argument? Then the argument parser trips over that and this is the error. You need to pass valid arguments. Otherwise you should be fine!
I just following you README ;)
There are several command line options available for training. These are defined in config.py. An example call which will train a 3-layer World-GAN TODO with 4000 iterations each scale would be:
$ python main.py *TODO* --alpha 100 --niter 4000 --nfc 64
:D Oh, sorry about that! I will fix the requirements and update the Readme accordingly.
OK, without TODO it works ...
D:\projects\github\Mawiszus\World-GAN>python main.py --alpha 100 --niter 4000 --nfc 64
c:\Users\rafal\miniconda3\lib\site-packages\torch\cuda\__init__.py:52: UserWarning: CUDA initialization: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx (Triggered internally at ..\c10\cuda\CUDAFunctions.cpp:100.)
return torch._C._cuda_getDeviceCount() > 0
Random Seed: 618
wandb: (1) Create a W&B account
wandb: (2) Use an existing W&B account
wandb: (3) Don't visualize my results
←[34m←[1mwandb←[0m: Enter your choice: 3
wandb: You chose 'Don't visualize my results'
CondaEnvException: Unable to determine environment
Please re-run this command with one of the following options:
* Provide an environment name via --name or -n
* Re-run this command inside an activated conda environment.
wandb: W&B syncing is set to `offline` in this directory.
wandb: Run `wandb online` or set WANDB_MODE=online to enable cloud syncing.
Traceback (most recent call last):
File "main.py", line 84, in <module>
main()
File "main.py", line 54, in main
real = mc_read_level(opt)
File "D:\projects\github\Mawiszus\World-GAN\minecraft\level_utils.py", line 157, in read_level
level, uniques, props = read_level_from_file(opt.input_dir, opt.input_name, opt.coords,
File "D:\projects\github\Mawiszus\World-GAN\minecraft\level_utils.py", line 190, in read_level_from_file
with World(input_name, input_dir, debug=debug) as wrld:
File "D:\projects\github\Mawiszus\World-GAN\PyAnvilEditor\pyanvil\world.py", line 261, in __init__
raise FileNotFoundError(f'No such folder \"{self.world_folder}\"')
FileNotFoundError: No such folder "input\mario\lvl_1-1.txt"
wandb: Waiting for W&B process to finish, PID 21672... (failed 1).
wandb: You can sync this run to the cloud by running:
wandb: wandb sync output\wandb\offline-run-20211026_125142-3uzlivqb
wandb: Find logs at: output\wandb\offline-run-20211026_125142-3uzlivqb\logs\debug.log
wandb: