I want converting image into array, for that I'm using np.array and load_image to load the image from the path.but it is not working. I'm getting error like, " AttributeError: 'NoneType' object has no attribute 'session' "
I want converting image into array, for that I'm using np.array and load_image to load the image from the path.but it is not working. I'm getting error like, " AttributeError: 'NoneType' object has no attribute 'session' "
Could you give a little more detail -- what code you're running, and what the full error traceback is?
I put my train images in the folder train and now I want to convert my image into array.so,its my command. " train_df["images"] = [np.array(load_img("/home/Rupika/train/images/{}.png".format(idx), grayscale=True)) / 255 for idx in tqdm_notebook(train_df.index)] " And my error, I'm getting is...
Traceback (most recent call last): File "/home/Rupika/salt.py", line 46, in <module> train_df["images"] = [np.array(load_img("/home/Rupika/train/images/{}.png".format(idx), grayscale=True)) / 255 for idx in tqdm_notebook(train_df.index)] File "/home/Rupika/.local/lib/python3.6/site-packages/tqdm/init.py", line 25, in tqdm_notebook return _tqdm_notebook(args, *kwargs) File "/home/Rupika/.local/lib/python3.6/site-packages/tqdm/_tqdm_notebook.py", line 200, in init self.fp, self.total, self.desc, self.ncols) File "/home/Rupika/.local/lib/python3.6/site-packages/tqdm/_tqdm_notebook.py", line 114, in status_printer container = HBox(children=[pbar, ptext]) File "/usr/local/lib/python3.6/dist-packages/ipywidgets/widgets/widget_box.py", line 93, in HBox box.layout.display = 'flex' File "/usr/local/lib/python3.6/dist-packages/traitlets/traitlets.py", line 585, in set self.set(obj, value) File "/usr/local/lib/python3.6/dist-packages/traitlets/traitlets.py", line 574, in set self.set(obj, value) obj._notify_trait(self.name, old_value, new_value) File "/usr/local/lib/python3.6/dist-packages/traitlets/traitlets.py", line 1139, in _notify_trait type='change', File "/usr/local/lib/python3.6/dist-packages/ipywidgets/widgets/widget.py", line 367, in notify_change self.send_state(key=name) File "/usr/local/lib/python3.6/dist-packages/ipywidgets/widgets/widget.py", line 263, in send_state self._send(msg, buffers=buffers) File "/usr/local/lib/python3.6/dist-packages/ipywidgets/widgets/widget.py", line 487, in _send self.comm.send(data=msg, buffers=buffers) File "/usr/local/lib/python3.6/dist-packages/ipykernel/comm/comm.py", line 121, in send data=data, metadata=metadata, buffers=buffers, File "/usr/local/lib/python3.6/dist-packages/ipykernel/comm/comm.py", line 66, in _publish_msg self.kernel.session.send(self.kernel.iopub_socket, msg_type, AttributeError: 'NoneType' object has no attribute 'session'
You're getting that error because tqdm_notebook expects to run in a jupyter notebook and you're not running it in a notebook.