Repository: mlcommons/inference
Issue: TypeError: 'module' object is not callable
Root cause: Environment Incompatibility

Both
1.  ./run_local.sh tf resnet50 cpu --scenario MultiStream  
2.  ./run_and_time.sh tf resnet50 gpu --scenario MultiStream
resulting in error

./run_local.sh tf resnet50 cpu --scenario MultiStream 
INFO:main:Namespace(accuracy=False, backend='tensorflow', cache=0, config='../mlperf.conf', count=None, data_format=None, dataset='imagenet', dataset_list=None, dataset_path='~/CK-TOOLS/dataset-imagenet-ilsvrc2012-val', find_peak_performance=False, inputs=['input_tensor:0'], max_batchsize=32, max_latency=None, model='~/CK-TOOLS/resnet50_v1.pb', model_name='resnet50', output='/home/ubuntu/mlperf_inference/v0.5/classification_and_detection/output/tf-cpu/resnet50', outputs=['ArgMax:0'], profile='resnet50-tf', qps=None, samples_per_query=None, scenario='MultiStream', threads=72, time=None)

Traceback (most recent call last):
  File "python/main.py", line 540, in <module>
    main()
  File "python/main.py", line 471, in main
    runner = runner_map[scenario](model, ds, args.threads, post_proc=post_proc, max_batchsize=args.max_batchsize)
  File "python/main.py", line 328, in __init__
    self.tasks = Queue(maxsize=threads * 4)
TypeError: 'module' object is not callable
_________________________________________________________________________________________
 ./run_and_time.sh tf resnet50 gpu --scenario MultiStream
INFO:main:Namespace(accuracy=False, backend='tensorflow', cache=0, config='./mlperf.conf', count=None, data_format=None, dataset='imagenet', dataset_list=None, dataset_path='/home/ubuntu/CK-TOOLS/dataset-imagenet-ilsvrc2012-val', find_peak_performance=False, inputs=['input_tensor:0'], max_batchsize=32, max_latency=None, model='/home/ubuntu/CK-TOOLS/resnet50_v1.pb', model_name='resnet50', output='/output', outputs=['ArgMax:0'], profile='resnet50-tf', qps=None, samples_per_query=None, scenario='MultiStream', threads=72, time=None)
Traceback (most recent call last):
  File "python/main.py", line 540, in <module>
    main()
  File "python/main.py", line 471, in main
    runner = runner_map[scenario](model, ds, args.threads, post_proc=post_proc, max_batchsize=args.max_batchsize)
  File "python/main.py", line 328, in __init__
    self.tasks = Queue(maxsize=threads * 4)
TypeError: 'module' object is not callable
ENDING RUN AT

I don't see this. Is this on python3.5 or better ?

> I don't see this. Is this on python3.5 or better ?

Python 3.6.8

Other than default SingleStream  any other scenario resulting the same error

SingleStream doesn't use a queue. I don't know why this fails for you ... we import Queue with
```
from queue import Queue
```
[here](https://github.com/mlperf/inference/blob/master/v0.5/classification_and_detection/python/main.py#L18) and since that does not fail I can't explain why Queue would not be available later.

Something is different in your setup. Is there maybe a directory 'queue' in your working directory ?


Thanks Guenther, Updated to  from queue import Queue
that is working...
History:
That import statement was giving error So I have modified that with the following
#from Queue import Queue
try:
        import queue as Queue
except ImportError:
        import Queue 

There is no directory queue in my working directory

import queue statement was problem correcting that resolved the issue