Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evaluation script error #10

Open
WitchDD opened this issue Jan 21, 2022 · 9 comments
Open

Evaluation script error #10

WitchDD opened this issue Jan 21, 2022 · 9 comments

Comments

@WitchDD
Copy link

WitchDD commented Jan 21, 2022

Thank you friends for suggesting interesting things!
python run_metrics.py --models_list weights / eval_list --outputmetric_results.csv

When I do this I get this error:
usage: run_metrics.py [-h] [--models_list MODELS_LIST] [--output OUTPUT] [--model_root MODEL_ROOT] [--eval_root EVAL_ROOT] [--sample_root SAMPLE_ROOT] [--batch_size BATCH_SIZE] [--eval_samples EVAL_SAMPLES] [--device DEVICE] run_metrics.py: error: unrecognized arguments: / eval_list --outputmetric_results.csv

It looks like the arguments aren't working. I want you to find a concrete solution.
thank you!

@WitchDD WitchDD changed the title Evaluate the script Evaluate Evaluation script error Jan 21, 2022
@PeterWang512
Copy link
Owner

Can you try removing the space like this?
python run_metrics.py --models_list weights/eval_list --output metric_results.csv

@WitchDD
Copy link
Author

WitchDD commented Jan 24, 2022

Another error will occur.
`al_list --output metric_results.csv
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "/home/test/anaconda3/envs/gan/lib/python3.6/multiprocessing/pool.py", line 119, in worker
result = (True, func(*args, **kwds))
File "/home/test/GANSketching/run_metrics.py", line 105, in run_vgg
from eval.precision_recall import metrics as pr
ImportError: cannot import name 'metrics'
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "run_metrics.py", line 155, in
metrics[name] = get_metrics(opt, name, target)
File "run_metrics.py", line 56, in get_metrics
stats_fake = get_stats(opt, g, fake_folder)
File "run_metrics.py", line 87, in get_stats
vgg_features = get_vgg_features(folder, opt.eval_samples, opt.batch_size)
File "run_metrics.py", line 101, in get_vgg_features
return p.apply(run_vgg, (folder, eval_samples, batch_size,))
File "/home/test/anaconda3/envs/gan/lib/python3.6/multiprocessing/pool.py", line 259, in apply
return self.apply_async(func, args, kwds).get()
File "/home/test/anaconda3/envs/gan/lib/python3.6/multiprocessing/pool.py", line 644, in get
raise self._value
ImportError: cannot import name 'metrics'
`

@PeterWang512
Copy link
Owner

It could be that you haven't pulled the submodules. I would try running git submodule update --init --recursive in the repo and then run the script.

@WitchDD
Copy link
Author

WitchDD commented Jan 24, 2022

As instructed, I ran it in the following order, but I get the same error.

①git submodule update --init --recursive
②bash scripts/train_teaser_cat.sh
③Access 'https://wandb.ai'  -> The execution result is generated in / GANSketching / wandb.
④python run_metrics.py --models_list weights/eval_list --output metric_results.csv   ->Here, the previous error appears

@PeterWang512
Copy link
Owner

PeterWang512 commented Jan 24, 2022

Can you check if metrics.py exists in eval/precision_recall? It should exist if you pulled the submodules

@WitchDD
Copy link
Author

WitchDD commented Jan 24, 2022

eval/precision_recall was missing metrics.py

Why doesn't git submodule update --init --recursive respond?

@PeterWang512
Copy link
Owner

I'm not sure about the cause, but as a temporary fix, you can pull the precision_recall directly at here: https://github.com/PeterWang512/precision_recall
and move the folder to in the eval folder

@WitchDD
Copy link
Author

WitchDD commented Jan 27, 2022

I installed tensorflow-gpu == 1.5.0 because of a dnnlib error.
However, this new error has occurred and I would like to ask for a solution.

`al_list --output metric_results.csv
/home/anaconda3/envs/gan/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:493: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint8 = np.dtype([("qint8", np.int8, 1)])
/home/anaconda3/envs/gan/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:494: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint8 = np.dtype([("quint8", np.uint8, 1)])
/home/anaconda3/envs/gan/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:495: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint16 = np.dtype([("qint16", np.int16, 1)])
/home/anaconda3/envs/gan/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:496: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint16 = np.dtype([("quint16", np.uint16, 1)])
/home/anaconda3/envs/gan/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:497: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint32 = np.dtype([("qint32", np.int32, 1)])
/home/anaconda3/envs/gan/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:502: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
np_resource = np.dtype([("resource", np.ubyte, 1)])
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "/home/anaconda3/envs/gan/lib/python3.6/multiprocessing/pool.py", line 119, in worker
result = (True, func(*args, **kwds))
File "/home/GANSketching/run_metrics.py", line 105, in run_vgg
from eval.precision_recall import metrics as pr
File "/home/GANSketching/eval/precision_recall/metrics.py", line 13, in
from utils import init_tf
ImportError: cannot import name 'init_tf'
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "run_metrics.py", line 155, in
metrics[name] = get_metrics(opt, name, target)
File "run_metrics.py", line 56, in get_metrics
stats_fake = get_stats(opt, g, fake_folder)
File "run_metrics.py", line 87, in get_stats
vgg_features = get_vgg_features(folder, opt.eval_samples, opt.batch_size)
File "run_metrics.py", line 101, in get_vgg_features
return p.apply(run_vgg, (folder, eval_samples, batch_size,))
File "/home/anaconda3/envs/gan/lib/python3.6/multiprocessing/pool.py", line 259, in apply
return self.apply_async(func, args, kwds).get()
File "/home/anaconda3/envs/gan/lib/python3.6/multiprocessing/pool.py", line 644, in get
raise self._value
ImportError: cannot import name 'init_tf'
`

@PeterWang512
Copy link
Owner

I'll look into this issue, and see if I can reproduce this error. Stay tuned!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants