recently noticed this error while using the process pool! The following is a simplified version of the call itself. Regardless of the syntax error, the second parameter of the map function contains an iterator containing an instance of the class that contains the session
of tensorflow initialized by a model parameter
def func(net):
return net.predict()
class Detecter(object):
def __init__(self, file):
with tf.Graph().as_default():
self.sess = tf.Session()
tf.train.Saver(self.sess,file)
def predict(self):
self.sess.run()
detecter = [Detecter('./model.ckpt')]*4
for batch in range(0,4,4):
bb = multiprocessing.pool.map(func, izip(detecter[:4]))
solution: change the original “from multiprocessing import Pool” to “from multiprocessing. Pool import ThreadPool as Pool”
Read More:
- Python2 PicklingError: Can‘t pickle <type ‘instancemethod‘>: attribute lookup __builtin__.instanceme
- Attributeerror: ‘module’ object has no attribute ‘handlers’ — Python sub module import problem
- Tensorflow reported an error when using session module: attributeerror: module ‘tensorflow’ has no attribute ‘session’, which has been solved
- Attribute Error: ‘XXX‘ object has no attribute ‘module‘
- Attributeerror: module tensorflow no attribute app solution
- module ‘tensorflow‘ has no attribute ‘placeholder‘
- module ‘tensorflow_core._api.v2.train’ has no attribute ‘slice_input_producer’
- Module build failed: TypeError [ERR_INVALID_ARG_TYPE]: The “path“ argument must be of type string.
- AttributeError: module…ops‘ has no attribute ‘_TensorLike‘, ValueError: `updates` argument..eager
- How to Fix gdb error: Failed to import the site module,No module named ‘_sysconfigdata_m’
- Failed to import module __PyInstaller_hooks_0_IPython required by hook for module
- Problem solving module ‘ tensorflow.compat . V2 ‘has no attribute’ contrib ‘and importerror cannot import name’ auto ‘
- (EE) Failed to load module “fbdev” (module does not exist, 0)
- Module parse failed:Unexpectedtoken (1:0)You may need an appropriate loader to handle this file type
- AttributeError: module ‘keras.backend‘ has no attribute ‘eager‘
- [error] attributeerror: module ‘SIP’ has no attribute ‘setapi‘
- TypeError: object of type ‘builtin_function_or_method’ has no len()
- AttAttributeError: module ‘typing‘ has no attribute ‘NoReturn‘
- Error reporting: attributeerror: module ‘******* has no attribute’ ******* and other problems are solved
- Tensorflow error: module ‘tensorflow’ has no attribute ‘xxx’