Closed My12123 closed 1 year ago
For CLI, use --model-dir
to specify the model directory.
example
python -m waifu2x.cli --model-dir F:\nunif\models\waifu2x_mymodel -m scale -i input_image_or_dir.png -o output_image_or_dir.png
For waifu2x.web, use --art-model-dir
or --photo-model-dir
to specify the model directory.
However, the directory used by waifu2x.web must have all the noise level model files.
So I would suggest making a copy of waifu2x/pretrained_models/cunet/art
first, overwriting the trained model there, and then specifying it.
(nunif) F:\nunif>python -m waifu2x.cli --model-dir F:\nunif\models\waifu2x_mymodel -m scale -i F:\Загрузки\poster_1521773665852.jpg -o F:\Загрузки\3\poster_1521773665852.jpg
Traceback (most recent call last):
File "F:\1\envs\nunif\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "F:\1\envs\nunif\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "F:\nunif\waifu2x\cli.py", line 157, in
No error on my windows env.
Does it work when specifying waifu2x/pretrained_models/cunet/art
for --model-dir
?
example
mkdir tmp
python -m waifu2x.cli -m scale --model-dir .\waifu2x\pretrained_models\cunet\art\ -i .\waifu2x\docs\images\miku_128.png -o tmp\out.png
Also, would you post the results with DEBUG=1 when specifying your trained model? (expect powershell)
$env:DEBUG=1
python -m waifu2x.cli -m scale --model-dir F:\nunif\models\waifu2x_mymodel -i .\waifu2x\docs\images\miku_128.png -o tmp\out.png
Maybe it is a problem related to LOCALE (language setting).
Also try the following commands. (add -X utf8
for python )
python -X utf8 -m waifu2x.cli --model-dir F:\nunif\models\waifu2x_mymodel -m scale -i .\waifu2x\docs\images\miku_128.png -o tmp\out.png
Looking at #23, there seems to be something wrong with the module loading.
Have you made any changes?
For example, you accidentally deleted under waifu2x/models/
.
You can check the differences with the following commands.
git status waifu2x
Restoring nunif source code from the latest in git may fix it.
How do I launch my own model? Located in F:\nunif\models\waifu2x_mymodel