Benchmarks icon indicating copy to clipboard operation
Benchmarks copied to clipboard

Missing parameter causing errors in NT3 (P1B4)

Open vgutta opened this issue 3 years ago • 5 comments

While running Pilot 1 NT3 using the command python nt3_baseline_keras2.py --conf nt3_perf_bench_model.txt I ran into this error caused by a missing parameter

Traceback (most recent call last): File "nt3_baseline_keras2.py", line 290, in <module> main() File "nt3_baseline_keras2.py", line 286, in main run(gParameters) File "nt3_baseline_keras2.py", line 101, in run X_train, Y_train, X_test, Y_test = load_data(train_file, test_file, gParameters) File "nt3_baseline_keras2.py", line 70, in load_data if gParameters['add_noise']: KeyError: 'add_noise'

Issue is caused by these lines

https://github.com/ECP-CANDLE/Benchmarks/blob/a48c85a4d4d76905c3392b18e42bea4bd28c518c/Pilot1/NT3/nt3_baseline_keras2.py#L68-L82

It seems like the candle parser being used never includes the parameters being checked here

https://github.com/ECP-CANDLE/Benchmarks/blob/a48c85a4d4d76905c3392b18e42bea4bd28c518c/Pilot1/NT3/nt3_baseline_keras2.py#L30-L31

So is there a different way to run this (maybe different flags) to avoid this issue. Obviously commented out lines 68-82 in nt3_baseline_keras2.py works but was not sure if parameters such as 'add_noise' will ever make it through to NT3. If not then maybe commenting out these lines permanently will save others some trouble?

vgutta avatar Oct 19 '21 01:10 vgutta

OK, you need to add the lines: add_noise = False noise_gaussian = False to the nt3_perf_bench_model.txt.

All the keywords are parsed from the config file, so if they are not there they will not appear in gParameters and will cause an error. Adding those 2 lines is sufficient.

Alternatively, just run the benchmark with 'python nt3_baseline_keras2.py' and it will use the nt3_default_model.txt which contains the required keywords.

jmohdyusof avatar Oct 19 '21 14:10 jmohdyusof

Actually I tried without any changes to the repo on a different system and I did not run into any of those issues. I'll close this for now but I'll reply if I find the reason why it did that on the first system. Thanks for your help @jmohdyusof

vgutta avatar Oct 19 '21 15:10 vgutta

I can't see how it would run correctly without those keywords, unless you are using the default model file. We will push changes to master to fix the perf_bench_model

jmohdyusof avatar Oct 19 '21 15:10 jmohdyusof

You are right, I ran the default model file this time. Sorry for the confusion

vgutta avatar Oct 19 '21 15:10 vgutta

OK, the original answer still stands. The perf_bench_model file was not updated to include the keywords needed by the noise methods, so we will push an update to master to fix that.

jmohdyusof avatar Oct 19 '21 15:10 jmohdyusof