I have installed TensorBoard. Before launching, I have also written the code in my neural network training file.
sess = tf.Session()
writer = tf.summary.FileWriter("demo")
writer.add_graph(sess.graph)
When i try to launch TensorBoard from terminal, using this command tensorboard --logdir=logs/
I get this error.
Traceback (most recent call last):
File "/usr/local/bin/tensorboard", line 7, in <module>
from tensorboard.main import run_main
File "/usr/local/lib/python3.4/dist-packages/tensorboard/main.py", line 40, in <module>
from tensorboard import default
File "/usr/local/lib/python3.4/dist-packages/tensorboard/default.py", line 37, in <module>
from tensorboard.plugins.audio import audio_plugin
File "/usr/local/lib/python3.4/dist-packages/tensorboard/plugins/audio/audio_plugin.py", line 30, in <module>
from tensorboard.plugins.audio import metadata
File "/usr/local/lib/python3.4/dist-packages/tensorboard/plugins/audio/metadata.py", line 22, in <module>
from tensorboard.plugins.audio import plugin_data_pb2
File "/usr/local/lib/python3.4/dist-packages/tensorboard/plugins/audio/plugin_data_pb2.py", line 22, in <module>
serialized_pb=_b('\n+tensorboard/plugins/audio/plugin_data.proto\x12\x0btensorboard\"}\n\x0f\x41udioPluginData\x12\x0f\n\x07version\x18\x01 \x01(\x05\x12\x37\n\x08\x65ncoding\x18\x02 \x01(\x0e\x32%.tensorboard.AudioPluginData.Encoding\" \n\x08\x45ncoding\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x07\n\x03WAV\x10\x0b\x62\x06proto3')
TypeError: __new__() got an unexpected keyword argument 'serialized_options'
Is there a problem in my audio plugin or in the installation? I am using Ubuntu 14.04. I am a beginner, pardon if i have overlooked anything basic.
This happened to me on windows. I removed protobuf and libprotobuf and then reinstalled tensorboard, and it worked!
Not sure why, but while trying to find a solution like you it seemed like protobuf caused such issues in other libraries so I tried
Related
After updating gcloud from version 290.0.1 to version 306.0.0, I'm getting an error when I run a gsutil cp command:
Traceback (most recent call last):
File "/usr/lib/google-cloud-sdk/platform/gsutil/gsutil", line 21, in <module>
gsutil.RunMain()
File "/usr/lib/google-cloud-sdk/platform/gsutil/gsutil.py", line 122, in RunMain
import gslib.__main__
File "/usr/lib/google-cloud-sdk/platform/gsutil/gslib/__main__.py", line 53, in <module>
import boto
File "/usr/lib/google-cloud-sdk/platform/gsutil/gslib/vendored/boto/boto/__init__.py", line 1216, in <module>
boto.plugin.load_plugins(config)
File "/usr/lib/google-cloud-sdk/platform/gsutil/gslib/vendored/boto/boto/plugin.py", line 93, in load_plugins
_import_module(file)
File "/usr/lib/google-cloud-sdk/platform/gsutil/gslib/vendored/boto/boto/plugin.py", line 75, in _import_module
return imp.load_module(name, file, filename, data)
File "/usr/lib/python3.6/imp.py", line 235, in load_module
return load_source(name, filename, file)
File "/usr/lib/python3.6/imp.py", line 172, in load_source
module = _load(spec)
File "/usr/share/google/boto/boto_plugins/compute_auth.py", line 18, in <module>
import urllib2
ModuleNotFoundError: No module named 'urllib2'
Following the downgrade instructions at https://cloud.google.com/sdk/docs/downloads-apt-get#downgrading_cloud_sdk_versions temporarily fixes the issue:
sudo apt-get update && sudo apt-get install google-cloud-sdk=290.0.1-0
But I'd like to know how to get this working with the latest version.
I have installed the version 306.0.0 and I ran a gcloud cp command, but I didn't face the issue. For this reason, checking for causes for the error ModuleNotFoundError: No module named 'urllib2', it seems that they are always related to a Python library that isn't working correctly - as you can check in this two examples here and here.
However, in further searches, this plugin usually is used within Compute Engine and startup scripts to VMs with Python, more specific relating to the file compute_auth.py - which in the message seems to be related to the error - and as you can check for more information here about this file.
Considering that, the new version of Cloud SDK bring some updates to Compute Engine that could be causing the error. In case you are indeed, using Python within your applications, I would give it a try the solution from this case here, that would be to update the file compute_auth.py, changing the line import urllib2 toimport urllib.request as urllib2.
In case this doesn't fix, raising a bug within Google's Issue Tracker will be the best option, for a further investigation.
I had a similar case. In my case, Travis CI/CD was giving the below error. What I did is add the below script to my .travis.yml file before_script section.
Error:
Traceback (most recent call last):
635 File "/usr/lib/google-cloud-sdk/platform/gsutil/gsutil", line 21, in <module>
636 gsutil.RunMain()
637 File "/usr/lib/google-cloud-sdk/platform/gsutil/gsutil.py", line 121, in RunMain
638 import gslib.__main__
639 File "/usr/lib/google-cloud-sdk/platform/gsutil/gslib/__main__.py", line 83, in <module>
640 import httplib2
641ModuleNotFoundError: No module named 'httplib2'
642error Command failed with exit code 1
Fix:
before_script:
- pip install httplib2 crcmod
I am trying to use OpenNMT-py with python 2.7. OpenNMT-py requires torchtext, so I installed it but now when I am running my program, I am getting the following error message.
Traceback (most recent call last):
File "examples/StackPointerParser.py", line 23, in <module>
from neuronlp2.io import get_logger, conllx_stacked_data
File "./neuronlp2/__init__.py", line 7, in <module>
from . import models
File "./neuronlp2/models/__init__.py", line 4, in <module>
from .parsing import *
File "./neuronlp2/models/parsing.py", line 15, in <module>
from onmt.modules import LayerNorm, Transformer
File "/home/wasiahmad/software/anaconda2/lib/python2.7/site-packages/onmt/__init__.py", line 1, in <module>
import onmt.io
File "/home/wasiahmad/software/anaconda2/lib/python2.7/site-packages/onmt/io/__init__.py", line 1, in <module>
from onmt.io.IO import collect_feature_vocabs, make_features, \
File "/home/wasiahmad/software/anaconda2/lib/python2.7/site-packages/onmt/io/IO.py", line 8, in <module>
import torchtext.data
File "/home/wasiahmad/software/anaconda2/lib/python2.7/site-packages/torchtext/__init__.py", line 1, in <module>
from . import data
File "/home/wasiahmad/software/anaconda2/lib/python2.7/site-packages/torchtext/data/__init__.py", line 4, in <module>
from .field import RawField, Field, ReversibleField, SubwordField, NestedField, LabelField
File "/home/wasiahmad/software/anaconda2/lib/python2.7/site-packages/torchtext/data/field.py", line 61, in <module>
class Field(RawField):
File "/home/wasiahmad/software/anaconda2/lib/python2.7/site-packages/torchtext/data/field.py", line 115, in Field
torch.float32: float,
AttributeError: 'module' object has no attribute 'float32'
I tried to look for a solution to resolve this issue but couldn't find any. Any help would be appreciated.
This is more a guess, as you have not given information about your version. But it seems to me that your torchtext version is not compatible with your PyTorch version.
Probably when you installed torchtext you got the newer version already made for PyTorch 0.4.0. But your PyTorch version installed is still older than 0.4.0 (version 0.3.1 or so).
If that is the case you have two options. Downgrading torchtext to a version compatible to yours (probably the version before). Or upgrading PyTorch to version 0.4.0.
I hope this helps.
What's your pytorch version? As per the readme of the github repo of torchtext :
For PyTorch versions before 0.4.0, please use pip install torchtext==0.2.3.
I was facing this exact problem with pytorch 0.3.1 and torchtext 0.3.0. I uninstalled torchtext and then installed it with
pip install torchtext==0.2.3.
And it worked for me. Let me know if you face any other problems.
I have read many posts about problems but none of them can solve mine. Although I have been following this blog exactly I still get this error when I try to run one of the example src python files:
Traceback (most recent call last):
File "facility.py", line 25, in <module>
import cplex
File "/Users/sb/Applications/IBM/ILOG/CPLEX_Studio1251/cplex/python/x86_darwin/cplex/__init__.py", line 43, in <module>
import callbacks
File "/Users/sb/Applications/IBM/ILOG/CPLEX_Studio1251/cplex/python/x86_darwin/cplex/callbacks.py", line 48, in <module>
from _internal._aux_functions import apply_freeform_two_args, apply_freeform_one_arg
File "/Users/sb/Applications/IBM/ILOG/CPLEX_Studio1251/cplex/python/x86_darwin/cplex/_internal/__init__.py", line 22, in <module>
import _list_array_utils
File "/Users/sb/Applications/IBM/ILOG/CPLEX_Studio1251/cplex/python/x86_darwin/cplex/_internal/_list_array_utils.py", line 13, in <module>
import _pycplex as CPX
File "/Users/sb/Applications/IBM/ILOG/CPLEX_Studio1251/cplex/python/x86_darwin/cplex/_internal/_pycplex.py", line 19, in <module>
_pycplex_platform = swig_import_helper()
File "/Users/sb/Applications/IBM/ILOG/CPLEX_Studio1251/cplex/python/x86_darwin/cplex/_internal/_pycplex.py", line 15, in swig_import_helper
_mod = imp.load_module('_pycplex_platform', fp, pathname, description)
File "/Users/sb/Applications/IBM/ILOG/CPLEX_Studio1251/cplex/python/x86_darwin/cplex/_internal/_pycplex_platform.py", line 23, in <module>
from cplex._internal.py1013_cplex1251 import *
ImportError: dlopen(/Users/sb/Applications/IBM/ILOG/CPLEX_Studio1251/cplex/python/x86_darwin/cplex/_internal/py1013_cplex1251.so, 2): no suitable image found. Did find:
/Users/sb/Applications/IBM/ILOG/CPLEX_Studio1251/cplex/python/x86_darwin/cplex/_internal/py1013_cplex1251.so: mach-o, but wrong architecture
Unfortunately I am not familiar with the /.bash_profile but what is posted in the link I added at the end.
Can please someone help me out here?
A possible solution to this would be to check whether you can copy the cplex directory manually over towards the site-packages that are installed (you may need to use sudo).
From your stacktrace I see that you have installed cplex into
/Users/sb/Applications/IBM/ILOG/CPLEX_Studio1251/cplex/python/x86_darwin/
First run (I assume you python 2.7) in the interactive shell:
import site; site.getsitepackages()
See How do I find the location of my Python site-packages directory? for details about this step.
This will give you the directory of the site-packages where you need to copy the "cplex" directory to. I assume it is /Library/Python/2.7/site-packages from here
on a mac then run:
sudo cp -r ./cplex /Library/Python/2.7/site-packages/
This sets up the cplex manually as an importable package for your python installation. You should therefore be able to import cplex within the python interactive shell.
I recently downloaded PyObjC to my Mac OS X El Capitan version 10.11.3, so that I could import the AppKit module in PsychoPy. When I attempted to run my script though I received the following error:
ImportError: The 'packaging' package is required; normally this is bundled with this
package so if you get this warning, consult the packager of your distribution.
I had read online that downgrading setuptools to version 19.2 will help, so I did that but am still running into the same error in PsychoPy. Is there some other way to address this error or am I doing something wrong?
Edit:
Here is the complete error message that I receive:
Traceback (most recent call last):
File "/Users/Dustin/Desktop/CMNT/CMNT.psychopy.py", line 8, in <module>
from AppKit import NSScreen
File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/AppKit/__init__.py",
line 8, in <module>
import objc
File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/objc/__init__.py", line 32, in <module>
from objc._bridgesupport import *
File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/objc/
_bridgesupport.py", line 13, in <module>
import pkg_resources
File "pkg_resources/__init__.pyc", line 75, in <module>
File "pkg_resources/extern/__init__.pyc", line 60, in load_module
ImportError: The 'packaging' package is required; normally this is bundled with this
package so if you get this warning, consult the packager of your distribution.
I installed ATpy-0.9.7 on my pc successfully and I also have the Python version of "2.7.5".
But when I import atpy I get the following error message:
>>> import atpy
ERROR: ImportError: No module named _sqlite3 [unknown]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "atpy/__init__.py", line 1, in <module>
from .basetable import Table, TableSet, VectorException
File "atpy/basetable.py", line 15, in <module>
from . import registry
File "atpy/registry.py", line 186, in <module>
from . import sqltable
File "atpy/sqltable.py", line 10, in <module>
from . import sqlhelper as sql
File "atpy/sqlhelper.py", line 11, in <module>
import sqlite3
File "/export/aibn84_2/zahra/lib/Python-2.7.5/lib/python2.7/sqlite3/__init__.py", line 24, in <module>
from dbapi2 import *
File "/export/aibn84_2/zahra/lib/Python-2.7.5/lib/python2.7/sqlite3/dbapi2.py", line 27, in <module>
from _sqlite3 import *
ImportError: No module named _sqlite3
I also installed db_sqlite3.egg-info. I don't know why this error message occurs!
I installed again th python2.7.5 with the following command :
./configure --prefix=$PYTHONPATH
but I also get this error after executing make:
Python build finished, but the necessary bits to build these modules were not found:
_bsddb _sqlite3 bsddb185
dbm dl gdbm
imageop sunaudiodev
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
How could I run configure in order to install required C libraries?
If you are using a self built version of Python you need to ensure that both the base and the development sqllite3 packages are installed on your system before building Python.
If they are not and, as you said, you do not have superuser privileges, you can download and build sqlite locally, and get your Python build to use that version. This blog post describes how.
According to this question
How can I install sqlite3 to Python?
...you shouldn't have to install anything to get sqlite3 for python. Before I could import atpy I did have to install astropy (which was quite involved). After I did that, everything worked.