Model without rotation augmentation
BorisMansencal opened this issue · 3 comments
Hi,
I am trying to test the pre-trained models on a given image.
I am able to use the model with rotation augmentation:
python main.py --task=test --subtask=kp --test_img_file=image1.jpg --test_out_file=image1_kp.txt --pretrained_kp=MODELS/release-aug/kp --use_batch_norm=False --mean_std_type=hardcoded --logdir=logs/test
However I get an error when I try to use the model without rotation augmentation:
python main.py --task=test --subtask=kp --test_img_file=image1.jpg --test_out_file=image1_kp.txt --pretrained_kp=MODELS/release-no-aug/kp --use_batch_norm=False --mean_std_type=dataset --logdir=logs/test
[...]
-- Recomputing dataset mean/std...
Traceback (most recent call last):
File "main.py", line 108, in <module>
tf.app.run(main=main, argv=[sys.argv[0]] + unparsed)
File "/tensorflow1.4/local/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "main.py", line 77, in main
task = Tester(config, rng)
File "tf-lift/tester.py", line 81, in __init__
self.network = Network(self.sess, self.config, self.dataset)
File "tf-lift/networks/lift.py", line 99, in __init__
_d = self.dataset.data["train"]["patch"][:, :, :, :]
AttributeError: 'Dataset' object has no attribute 'data'
The problem comes from the mean_std_type=dataset option. With the other mean_std_type, it seems ok.
Do I have to specify something else ?
I see the files mean.h5 and std.h5 in MODELS/release-no-aug/kp.
Thanks,
Boris.
I also have this problem. If I add --mean_std_type=dataset, it shows: AttributeError: 'Dataset' object has no attribute 'data' (the same as yours)
I tried to delete "--mean_std_type=dataset", then there is a problem of "Could not load network weights"
As follows:
Traceback (most recent call last):
File "main.py", line 98, in
tf.app.run(main=main, argv=[sys.argv[0]] + unparsed)
File "/home/qiu/tensorflow/venv/lib/python3.5/site-packages/tensorflow/python/platform/app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "main.py", line 70, in main
task.run()
File "/home/qiu/Documents/tf-lift/tester.py", line 110, in run
raise RuntimeError("Could not load network weights!")
RuntimeError: Could not load network weights!
I have the same problem....
python main.py --test_img_file=D:/image1.jpg --test_out_file=D:/image1_kp.txt --task=test --subtask=kp --logdir="logs/main.py"
Traceback (most recent call last):
File "main.py", line 98, in
tf.app.run(main=main, argv=[sys.argv[0]] + unparsed)
File "C:\Anaconda3\lib\site-packages\tensorflow\python\platform\app.py", line
48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "main.py", line 70, in main
task.run()
File "D:\tf-lift-master\tester.py", line 110, in run
raise RuntimeError("Could not load network weights!")
RuntimeError: Could not load network weights!