error while uploading kaggle.json file in google colab - google-colaboratory

I am finding issue while uploading kaggle.json file in google colab, with following command
from google.colab import files
uploaded = files.upload()
error :
*MessageError Traceback (most recent call last)
<ipython-input-7-21dc3c638f66> in <module>()
1 from google.colab import files
----> 2 uploaded = files.upload()
2 frames
/usr/local/lib/python3.6/dist-packages/google/colab/_message.py in read_reply_from_input(message_id, timeout_sec)
104 reply.get('colab_msg_id') == message_id):
105 if 'error' in reply:
--> 106 raise MessageError(reply['error'])
107 return reply.get('data', None)
108
MessageError: TypeError: Cannot read property '_uploadFiles' of undefined*

Related

Why i have import error mac m1 when I use tensorflow?

I have installed tensorflow on my enviroment for mac with m1.
The problem is the following:
---------------------------------------------------------------------------
NotFoundError Traceback (most recent call last)
/Users/marcovinciguerra/Desktop/ciao.ipynb Cella 1 in <cell line: 5>()
3 import pandas as pd
4 import sklearn as sk
----> 5 import tensorflow as tf
6 import platform
8 print(f"Python Platform: {platform.platform()}")
File /opt/homebrew/Caskroom/miniforge/base/envs/tensorflow/lib/python3.9/site-packages/tensorflow/__init__.py:443, in <module>
441 _plugin_dir = _os.path.join(_s, 'tensorflow-plugins')
442 if _os.path.exists(_plugin_dir):
--> 443 _ll.load_library(_plugin_dir)
444 # Load Pluggable Device Library
445 _ll.load_pluggable_device_library(_plugin_dir)
File /opt/homebrew/Caskroom/miniforge/base/envs/tensorflow/lib/python3.9/site-packages/tensorflow/python/framework/load_library.py:151, in load_library(library_location)
148 kernel_libraries = [library_location]
150 for lib in kernel_libraries:
--> 151 py_tf.TF_LoadLibrary(lib)
153 else:
154 raise OSError(
155 errno.ENOENT,
156 'The file or folder to load kernel libraries from does not exist.',
157 library_location)
NotFoundError:
dlopen(/opt/homebrew/Caskroom/miniforge/base/envs/tensorflow/lib/python3.9/site-
packages/tensorflow-plugins/libmetal_plugin.dylib, 0x0006): Symbol not found:
_OBJC_CLASS_$_MPSGraphRandomOpDescriptor
Referenced from:
/opt/homebrew/Caskroom/miniforge/base/envs/tensorflow/lib/python3.9/site-
packages/tensorflow-plugins/libmetal_plugin.dylib
Expected in:
/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Versions/A/MetalPerformanceShadersGraph
I use conda to see all my dependencies installed and all the tensorflow requirements are
installed.
I followed the following guide: https://github.com/jeffheaton/t81_558_deep_learning/blob/master/install/tensorflow-install-mac-metal-jul-2021.ipynb
What should I do?
Very anecdotally, I was having the same issue and I solved it by updating my Mac, from version 12.0.1 to 12.5.1.

Streamlit error in jupyter notebook background

OSError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_6872/2503841040.py in <module>
----> 1 get_ipython().system('nohup streamlit run app.py&')
C:\ProgramData\Anaconda3\lib\site-packages\ipykernel\zmqshell.py in system_piped(self, cmd)
620 # os.system() or use ip.system=ip.system_raw
621 # if they really want a background process.
--> 622 raise OSError("Background processes not supported.")
623
624 # we explicitly do NOT return the subprocess status code, because
OSError: Background processes not supported.

I installed tensforflow and used the command but it shows the following error

The code I wrote was this:
from tensorflow.keras.models import Sequential
and this is the error which was given...
it would be great if someone could tell a way out
ImportError Traceback (most recent call last)
~\Python\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in <module>
63 try:
---> 64 from tensorflow.python._pywrap_tensorflow_internal import *
65 # This try catch logic is because there is no bazel equivalent for py_extension.
ImportError: DLL load failed while importing _pywrap_tensorflow_internal: The specified module could not be found.
During handling of the above exception, another exception occurred:
ImportError Traceback (most recent call last)
<ipython-input-18-f05745da3b73> in <module>
----> 1 from tensorflow.keras.models import Sequential
~\Python\lib\site-packages\tensorflow\__init__.py in <module>
39 import sys as _sys
40
---> 41 from tensorflow.python.tools import module_util as _module_util
42 from tensorflow.python.util.lazy_loader import LazyLoader as _LazyLoader
43
~\Python\lib\site-packages\tensorflow\python\__init__.py in <module>
37 # go/tf-wildcard-import
38 # pylint: disable=wildcard-import,g-bad-import-order,g-import-not-at-top
---> 39 from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow
40
41 from tensorflow.python.eager import context
~\Python\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in <module>
81 for some common reasons and solutions. Include the entire stack trace
82 above this error message when asking for help.""" % traceback.format_exc()
---> 83 raise ImportError(msg)
84
85 # pylint: enable=wildcard-import,g-import-not-at-top,unused-import,line-too-long
ImportError: Traceback (most recent call last):
File "C:\Users\saksh\Python\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in <module>
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed while importing _pywrap_tensorflow_internal: The specified module could not be found.
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/errors
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
Error message says that some DLL files failed load, this because Tensorflow package is not installed properly.
Reason might be you not installed the MSVC 2019 redistributable or
Your CPU does not support AVX2 instructions.
Install the software requirements and make sure your system meet hardware requirements mentioned on the Tensorflow install document.

Hello i'm getting error while importing tensorflow in jupyter notebook

Help me
ImportError Traceback (most recent call last)
~\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in
63 try:
---> 64 from tensorflow.python._pywrap_tensorflow_internal import *
65 # This try catch logic is because there is no bazel equivalent for py_extension.
ImportError: DLL load failed while importing _pywrap_tensorflow_internal: The sp enter code here ecified module could not be found.
During handling of the above exception, another exception occurred:
ImportError Traceback (most recent call last)
<ipython-input-2-f2ccb964fe70> in <module>
----> 1 from tensorflow.keras.preprocessing.text import Tokenizer
2 from tensorflow.keras.preprocessing.sequence import pad_sequences
3 from sklearn.preprocessing import StandardScaler
4 from sklearn.model_selection import train_test_split
~\anaconda3\lib\site-packages\tensorflow\__init__.py in <module>
39 import sys as _sys
40
---> 41 from tensorflow.python.tools import module_util as _module_util
42 from tensorflow.python.util.lazy_loader import LazyLoader as _LazyLoader
43
~\anaconda3\lib\site-packages\tensorflow\python\__init__.py in <module>
38 # pylint: disable=wildcard-import,g-bad-import-order,g-import-not-at-top
39
---> 40 from tensorflow.python.eager import context
41
42 # pylint: enable=wildcard-import
~\anaconda3\lib\site-packages\tensorflow\python\eager\context.py in <module>
33 from tensorflow.core.protobuf import config_pb2
34 from tensorflow.core.protobuf import rewriter_config_pb2
---> 35 from tensorflow.python import pywrap_tfe
36 from tensorflow.python import tf2
37 from tensorflow.python.client import pywrap_tf_session
~\anaconda3\lib\site-packages\tensorflow\python\pywrap_tfe.py in <module>
26
27 # pylint: disable=invalid-import-order,g-bad-import-order, wildcard-import, unused-import
---> 28 from tensorflow.python import pywrap_tensorflow
29 from tensorflow.python._pywrap_tfe import *
~\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in <module>
81 for some common reasons and solutions. Include the entire stack trace
82 above this error message when asking for help.""" % traceback.format_exc()
---> 83 raise ImportError(msg)
84
85 # pylint: enable=wildcard-import,g-import-not-at-top,unused-import,line-too-long
ImportError: Traceback (most recent call last):
File "C:\Users\Gaganu\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in <module>
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed while importing _pywrap_tensorflow_internal: The specified module could not be found.
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/errors
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
Best way is if you are using anaconda environment,
conda create -n myenv python=3.7
conda activate myenv
then
pip install tensorflow
or
pip install tensorflow-gpu
See if this works, or if you have bazel error, let me know I will put that install guide here as well.

Tensorflow won't import in Colab

I'm new to ML and Colab. Trying to play around with the project at https://github.com/tkarras/progressive_growing_of_gans but having a hard time getting it running in Colab.
When I run the import_example.py script from the project, I get immediate errors relating to Tensorflow not loading. So I tried stepping back and simply doing import tensorflow as tf. When I run this, I get the below errors. I've got the runtime set to GPU. I was getting the same issue yesterday with the Colab demo GPU code, but that's working today.
Can anyone give me any pointers? It seems like basic stuff that should just work in the environment.
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/tensorflow/python/pywrap_tensorflow.py in <module>()
57
---> 58 from tensorflow.python.pywrap_tensorflow_internal import *
59 from tensorflow.python.pywrap_tensorflow_internal import __version__
/usr/local/lib/python3.6/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py in <module>()
27 return _mod
---> 28 _pywrap_tensorflow_internal = swig_import_helper()
29 del swig_import_helper
/usr/local/lib/python3.6/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py in swig_import_helper()
23 try:
---> 24 _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
25 finally:
/usr/lib/python3.6/imp.py in load_module(name, file, filename, details)
242 else:
--> 243 return load_dynamic(name, filename, file)
244 elif type_ == PKG_DIRECTORY:
/usr/lib/python3.6/imp.py in load_dynamic(name, path, file)
342 name=name, loader=loader, origin=path)
--> 343 return _load(spec)
344
ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory
During handling of the above exception, another exception occurred:
ImportError Traceback (most recent call last)
<ipython-input-8-64156d691fe5> in <module>()
----> 1 import tensorflow as tf
/usr/local/lib/python3.6/dist-packages/tensorflow/__init__.py in <module>()
22
23 # pylint: disable=g-bad-import-order
---> 24 from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
25
26 try:
/usr/local/lib/python3.6/dist-packages/tensorflow/python/__init__.py in <module>()
47 import numpy as np
48
---> 49 from tensorflow.python import pywrap_tensorflow
50
51 from tensorflow.python.tools import component_api_helper
/usr/local/lib/python3.6/dist-packages/tensorflow/python/pywrap_tensorflow.py in <module>()
72 for some common reasons and solutions. Include the entire stack trace
73 above this error message when asking for help.""" % traceback.format_exc()
---> 74 raise ImportError(msg)
75
76 # pylint: enable=wildcard-import,g-import-not-at-top,unused-import,line-too-long
ImportError: Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "/usr/lib/python3.6/imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "/usr/lib/python3.6/imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/errors
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.
To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------------------------------------------------
Even I was facing the same issue. Later I realized I forgot to enable GPU in notebook settings.
I enabled it and installed TensorFlow-GPU (GPU version).
You can find notebook settings in Edit > Notebook Settings.
Here's the screenshot
Check if you have installed the version of tensorflow that you need in Colab or not?! (Maybe you have installed a different version of tensorflow-gpu and you have not installed the corresponding tensorflow version. I got the same error in this case)
!pip list
If you do not have tensorflow in the list, you should install both tensorflow and tensorflow-gpu as follow:
!pip install tensorflow=='enter version here'
!pip install tensorflow-gpu=='enter same version as the previous one here'
You just have to read the error carefully:
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.
Try running:
!pip install tensorflow
inside notebook, and then rerun the cell with the import.
TensorFlow is included by default in Colab. So, I suspect you've somehow broken the existing install.
You can request a new backend by selecting the Runtime -> Reset all runtimes... menu. Then, try import tensorflow as tf again.