undefined symbol: _ZN2df12KinectFusion10save_modelESs from kinect_fusion - runtime

I do not have too much experience on kinect fusion. I am reproducing a framework from a paper, which requires kinect fusion. I can successfully compile kinect fusion. However, When I try to import kfusion for testing. It fails as :
+ set -e
+ export PYTHONUNBUFFERED=True
+ PYTHONUNBUFFERED=True
+ export CUDA_VISIBLE_DEVICES=0
+ CUDA_VISIBLE_DEVICES=0
++ date +%Y-%m-%d_%H-%M-%S
+ LOG=experiments/logs/test_kinect_fusion.txt.2018-06-16_19-47-30
+ exec
++ tee -a experiments/logs/test_kinect_fusion.txt.2018-06-16_19-47-30
+ echo Logging output to experiments/logs/test_kinect_fusion.txt.2018-06-16_19-47-30
Logging output to experiments/logs/test_kinect_fusion.txt.2018-06-16_19-47-30
+ ./tools/test_kinect_fusion.py --gpu 0 --imdb rgbd_scene_trainval --cfg experiments/cfgs/rgbd_scene.yml --rig data/RGBDScene/camera.json
Traceback (most recent call last):
File "./tools/test_kinect_fusion.py", line 13, in <module>
from kinect_fusion import kfusion
ImportError: /home/weizhang/DA-RNN/tools/../lib/kinect_fusion/kfusion.so: undefined symbol: _ZN2df12KinectFusion10save_modelESs
The files exists on path. I am not sure what might be the cause of undefined symbol.
Any comments and suggestions are appreciated.

Related

Ansible/python error: No module named ansible.errors

I have installed Ansible using "pip" as a root user on RHEL
python version - Python 2.7.5
Ansible version -
ansible 2.7.4
config file = None
configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /bin/ansible
python version = 2.7.5 (default, May 31 2018, 09:41:32) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]
whenever I try to use ansible as a different user getting an error
Error:
$ ansible --version
Traceback (most recent call last):
File "/usr/bin/ansible", line 40, in <module>
from ansible.errors import AnsibleError, AnsibleOptionsError, AnsibleParserError
ImportError: No module named ansible.errors
I find two ansible files located in different places, Is this abnormal?
one at /bin/ansible & other at /usr/bin/ansible
$ cd /bin
$ ls -lart ansible
-rwxr-xr-x 1 root root 5837 Dec 9 13:12 ansible
$ cd ansible
-ksh: cd: ansible: [Not a directory]
$ ls -lart /usr/bin/ansible
-rwxr-xr-x 1 root root 5837 Dec 9 13:12 /usr/bin/ansible
Content of /bin/ansible
$ cat /bin/ansible
#!/bin/python
# (c) 2012, Michael DeHaan <michael.dehaan#gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
########################################################
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
__requires__ = ['ansible']
try:
import pkg_resources
except Exception:
# Use pkg_resources to find the correct versions of libraries and set
# sys.path appropriately when there are multiversion installs. But we
# have code that better expresses the errors in the places where the code
# is actually used (the deps are optional for many code paths) so we don't
# want to fail here.
pass
import os
import shutil
import sys
import traceback
from ansible.errors import AnsibleError, AnsibleOptionsError, AnsibleParserError
from ansible.module_utils._text import to_text
# Used for determining if the system is running a new enough python version
# and should only restrict on our documented minimum versions
_PY3_MIN = sys.version_info[:2] >= (3, 5)
_PY2_MIN = (2, 6) <= sys.version_info[:2] < (3,)
_PY_MIN = _PY3_MIN or _PY2_MIN
if not _PY_MIN:
raise SystemExit('ERROR: Ansible requires a minimum of Python2 version 2.6 or Python3 version 3.5. Current version: %s' % ''.join(sys.version.splitlines()))
class LastResort(object):
# OUTPUT OF LAST RESORT
def display(self, msg, log_only=None):
print(msg, file=sys.stderr)
def error(self, msg, wrap_text=None):
print(msg, file=sys.stderr)
if __name__ == '__main__':
display = LastResort()
try: # bad ANSIBLE_CONFIG or config options can force ugly stacktrace
import ansible.constants as C
from ansible.utils.display import Display
except AnsibleOptionsError as e:
display.error(to_text(e), wrap_text=False)
sys.exit(5)
cli = None
me = os.path.basename(sys.argv[0])
try:
display = Display()
display.debug("starting run")
sub = None
target = me.split('-')
if target[-1][0].isdigit():
# Remove any version or python version info as downstreams
# sometimes add that
target = target[:-1]
if len(target) > 1:
sub = target[1]
myclass = "%sCLI" % sub.capitalize()
elif target[0] == 'ansible':
sub = 'adhoc'
myclass = 'AdHocCLI'
else:
raise AnsibleError("Unknown Ansible alias: %s" % me)
try:
mycli = getattr(__import__("ansible.cli.%s" % sub, fromlist=[myclass]), myclass)
except ImportError as e:
# ImportError members have changed in py3
if 'msg' in dir(e):
msg = e.msg
else:
msg = e.message
if msg.endswith(' %s' % sub):
raise AnsibleError("Ansible sub-program not implemented: %s" % me)
else:
raise
try:
args = [to_text(a, errors='surrogate_or_strict') for a in sys.argv]
except UnicodeError:
display.error('Command line args are not in utf-8, unable to continue. Ansible currently only understands utf-8')
display.display(u"The full traceback was:\n\n%s" % to_text(traceback.format_exc()))
exit_code = 6
else:
cli = mycli(args)
cli.parse()
exit_code = cli.run()
except AnsibleOptionsError as e:
cli.parser.print_help()
display.error(to_text(e), wrap_text=False)
exit_code = 5
except AnsibleParserError as e:
display.error(to_text(e), wrap_text=False)
exit_code = 4
# TQM takes care of these, but leaving comment to reserve the exit codes
# except AnsibleHostUnreachable as e:
# display.error(str(e))
# exit_code = 3
# except AnsibleHostFailed as e:
# display.error(str(e))
# exit_code = 2
except AnsibleError as e:
display.error(to_text(e), wrap_text=False)
exit_code = 1
except KeyboardInterrupt:
display.error("User interrupted execution")
exit_code = 99
except Exception as e:
if C.DEFAULT_DEBUG:
# Show raw stacktraces in debug mode, It also allow pdb to
# enter post mortem mode.
raise
have_cli_options = cli is not None and cli.options is not None
display.error("Unexpected Exception, this is probably a bug: %s" % to_text(e), wrap_text=False)
if not have_cli_options or have_cli_options and cli.options.verbosity > 2:
log_only = False
if hasattr(e, 'orig_exc'):
display.vvv('\nexception type: %s' % to_text(type(e.orig_exc)))
why = to_text(e.orig_exc)
if to_text(e) != why:
display.vvv('\noriginal msg: %s' % why)
else:
display.display("to see the full traceback, use -vvv")
log_only = True
display.display(u"the full traceback was:\n\n%s" % to_text(traceback.format_exc()), log_only=log_only)
exit_code = 250
finally:
# Remove ansible tmpdir
shutil.rmtree(C.DEFAULT_LOCAL_TMP, True)
sys.exit(exit_code)
list:
$ ls -lart /usr/lib/python2.7/site-packages/ansible/errors/
total 36
-rw------- 1 root root 3820 Dec 9 13:12 yaml_strings.py
-rw------- 1 root root 11555 Dec 9 13:12 __init__.py
-rw------- 1 root root 3147 Dec 9 13:12 yaml_strings.pyc
-rw------- 1 root root 11535 Dec 9 13:12 __init__.pyc
drwx------ 2 root root 88 Dec 9 13:12 .
drwx------ 17 root root 4096 Dec 9 13:12 ..
can anyone help me in solving it.
In my case I was working in a venv in python and that caused Ansible to not find all it's python modules. Might not necessarily be the OP's issue here but it's worth being aware of.
It's because the installation did not make the files in /usr/lib/python2.7/site-packages/ansible readable by groups or world, meaning that only the file's owner (root in this case) can read them:
$ ls -lart /usr/lib/python2.7/site-packages/ansible/errors/
total 36
-rw------- 1 root root 11555 Dec 9 13:12 __init__.py
# ^^^^^^ should be -rw-r--r-- for files
You can change this one specific problem with chmod but likely in the future you will want to run umask go-w first in order to keep pip from defaulting to 0600 permissions for files that it writes out
# chmod -R a+rX /usr/lib/python2.7/site-packages/ansible
The X in that expression is to set the eXecute bit but only for files that already have execute in the user's permissions (so, for directories and executable files, but not for "normal" files; you can read the full story in man 1 chmod)
In my case the problem turned out to be following:
i was executing the command using sudo, which was picking different .ssh/id_rsa.pub compared to what I had posted public key in the ssh-server. This was rightly resulting into permission denied.
This was discovered only by doing (taken from the dump that comes from ansible ping command using -vvv. Note that I have added -v command to ssh, that gives you the hint on what has failed during the login process.
sudo sshpass -d11 ssh -v -C -o ControlMaster=auto -o ControlPersist=60s -o 'User="ubuntu"' -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/66b206be85 10.115.216.134 '/bin/sh -c '"'"'echo ~ubuntu && sleep 0'"'"''
In my case, I was using a broken venv. Deactivated it, removed it and reinstalled every thing:
deactivate
rm -rf .venv
python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt

kpatch-build failure with Makefile target missing error

I'm trying to build a livepatch using kpatch-build insider a Docker container.
So far I am able to see the differences between the original and patched
.o files and creation of new object file.
But create-kpatch-module is not being called and I'm getting an error
indicating "Makefile target missing". I dug through the script, but I'm unable to identify the exact issue.
Can anyone shed some light on what might be wrong? What "Makefile target" is required?
I'm following link at: https://github.com/dynup/kpatch
Upon further inspection:
+ /usr/local/libexec/kpatch/create-kpatch-module /home/xyz/.kpatch/tmp/patch/tmp_output.o /home/xyz/.kpatch/tmp/patch/output.o
+ local to_stdout=1
+ [[ 1 -ge 2 ]]
+ [[ 1 -eq 1 ]]
+ tee -a /home/racker/.kpatch/build.log
+ check_pipe_status create-kpatch-module
+ rc=0
+ [[ 0 = 139 ]]
+ cd /home/xyz/.kpatch/tmp/patch
+ logger
+ KPATCH_BUILD=/source/linux
+ KPATCH_NAME=kpatch-4-4-0-2-modules-0-3-2-3-x86_64
+ KBUILD_EXTRA_SYMBOLS=/usr/lib/modules/4.4.0+2/extra/kpatch/Module.symvers
+ KPATCH_LDFLAGS=
+ make

QIIME2 dada2 rlang.so error

I was running the QIIME2 moving picture tutorial, at the dada2 step,
I was running:
qiime dada2 denoise-single \
--i-demultiplexed-seqs demux.qza \
--p-trim-left 0 \
--p-trunc-len 120 \
--o-representative-sequences rep-seqs-dada2.qza \
--o-table table-dada2.qza
and ran into this error:
Plugin error from dada2:
An error was encountered while running DADA2 in R (return code 1),
please inspect stdout and stderr to learn more.
Debug info has been saved to /tmp/qiime2-q2cli-err-52fzrvlu.log.
I then open the file: /tmp/qiime2-q2cli-err-52fzrvlu.log. this is what I found:
Running external command line application(s). This may print messages
to stdout and/or stderr. The command(s) being run are below. These
commands cannot be manually re-run as they will depend on temporary
files that no longer exist.
Command: run_dada_single.R
/tmp/qiime2-archive-pco6y5vm/fe614b44-775f-41b1-9ee3-04319005e830/data
/tmp/tmpda8dnyve/output.tsv.biom /tmp/tmpda8dnyve 120 0 2.0 2
consensus 1.0 1 1000000
R version 3.3.1 (2016-06-21) Loading required package: Rcpp Error in
dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared
object '/home/cao/lib/R/library/rlang/libs/rlang.so':
/home/cao/lib/R/library/rlang/libs/rlang.so: undefined symbol:
R_ExternalPtrAddrFn In addition: Warning message: package ‘Rcpp’ was
built under R version 3.4.1 Error: package or namespace load failed
for ‘dada2’ Execution halted Traceback (most recent call last): File
"/home/cao/miniconda3/envs/qiime2-2017.7/lib/python3.5/site-packages/q2_dada2/_denoise.py",
line 126, in denoise_single
run_commands([cmd]) File "/home/cao/miniconda3/envs/qiime2-2017.7/lib/python3.5/site-packages/q2_dada2/_denoise.py",
line 35, in run_commands
subprocess.run(cmd, check=True) File "/home/cao/miniconda3/envs/qiime2-2017.7/lib/python3.5/subprocess.py",
line 398, in run
output=stdout, stderr=stderr) subprocess.CalledProcessError: Command '['run_dada_single.R',
'/tmp/qiime2-archive-pco6y5vm/fe614b44-775f-41b1-9ee3-04319005e830/data',
'/tmp/tmpda8dnyve/output.tsv.biom', '/tmp/tmpda8dnyve', '120', '0',
'2.0', '2', 'consensus', '1.0', '1', '1000000']' returned non-zero
exit status 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File
"/home/cao/miniconda3/envs/qiime2-2017.7/lib/python3.5/site-packages/q2cli/commands.py",
line 222, in __call__
results = action(**arguments) File "<decorator-gen-252>", line 2, in denoise_single File
"/home/cao/miniconda3/envs/qiime2-2017.7/lib/python3.5/site-packages/qiime2/sdk/action.py",
line 201, in callable_wrapper
output_types, provenance) File "/home/cao/miniconda3/envs/qiime2-2017.7/lib/python3.5/site-packages/qiime2/sdk/action.py",
line 334, in _callable_executor_
output_views = callable(**view_args) File "/home/cao/miniconda3/envs/qiime2-2017.7/lib/python3.5/site-packages/q2_dada2/_denoise.py",
line 137, in denoise_single
" and stderr to learn more." % e.returncode) Exception: An error was encountered while running DADA2 in R (return code 1), please
inspect stdout and stderr to learn more.
I then 'sudo R' and installed the Rcpp and rlang packages, but still got the the same error when I run the same code as I first did:
qiime dada2 denoise-single \
--i-demultiplexed-seqs demux.qza \
--p-trim-left 0 \
--p-trunc-len 120 \
--o-representative-sequences rep-seqs-dada2.qza \
--o-table table-dada2.qza
I figured it out:
it was the R version: i uninstalled R3.4 and install R 3.3 and everythign works

Error in py2app application

(OSX = Mountain lion) My app in /dist throws the error:
Last login: Wed Aug 28 11:21:29 on ttys001
-MacBook-Pro:~ $ /Users/Desktop/dist/abc.app/Contents/MacOS/abc ; exit;
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/py2app/apptemplate/lib/site.py", line 20, in <module>
import os
File "os.pyc", line 398, in <module>
File "UserDict.pyc", line 83, in <module>
File "_abcoll.pyc", line 11, in <module>
File "/Users/Virendra/Desktop/dist/abc.app/Contents/Resources/abc.py", line 6, in <module>
import psutil
File "build/bdist.macosx-10.8-x86_64/egg/psutil/__init__.py", line 54, in <module>
File "build/bdist.macosx-10.8-x86_64/egg/psutil/_common.py", line 16, in <module>
File "build/bdist.macosx-10.8-x86_64/egg/psutil/_compat.py", line 65, in <module>
File "collections.pyc", line 6, in <module>
AttributeError: 'module' object has no attribute '__all__'
logout
My setup.py (same error even without the - 'import os') looks like:
"""
This is a setup.py script generated by py2applet
Usage:
python setup.py py2app
"""
from setuptools import setup
APP = ['abc.py']
DATA_FILES = []
OPTIONS = {'argv_emulation': True, 'includes': ['psutil', 'time', 'socket', 'os']}
setup(
app=APP,
data_files=DATA_FILES,
options={'py2app': OPTIONS},
setup_requires=['py2app'],
)
And the scrip abc.py in question:
from psutil import cpu_times_percent
import socket
import time
serverHost = "localhost"
thisClient = socket.gethostname()
cpuStats = psutil.cpu_times_percent()
print cpuStats
currentTime = int(time.time())
s = socket.socket()
s.connect((serverHost,8080))
command = 'put cpu.usr ' + str(currentTime) + " " + str(cpuStats[0]) + " host="+ thisClient+ "\n"
s.sendall(command)
command = 'put cpu.nice ' + str(currentTime) + " " + str(cpuStats[1]) +" host="+ thisClient+ "\n"
s.sendall(command)
command = 'put cpu.sys ' + str(currentTime) + " " + str(cpuStats[2]) + " host="+ thisClient+ "\n"
s.sendall(command)
command = 'put cpu.idle ' + str(currentTime) + " " + str(cpuStats[3]) + " host="+ thisClient+ "\n"
s.sendall(command)
s.close()
Initially it was 'import psutil' which I changed to the 'from psutil...' as above. Included the 'import os...' here. But all combinations throw the same error. Elsewhere, I have seen 'import psutil' as a standard import and this is no different. What else could the error AttributeError: 'module' object has no attribute '__all__' mean? Thx.
Your script file, abc.py, conflicts with the Python standard library Abstract Base Class module, abc. The simplest solution should be to just change the name of your file to something else.

File filtering_Python 3.2

I'm trying to write a short file filtering code in Python that will find my desired string.
I've got it worked out logically, but my Command Feed is sending me an error message for the print statement. This is how it works as of now:
filename = input('give file name: ')
n = input('give desired string: ')
f = open
line = f.readline()
while line:
if n in line:
print line
line = f.readline()
Error Statement:
Traceback (most recent call last):
File "<string>", line 7, in <fragment>
Syntax Error: print line: <string>, line 718
I know this is a simple problem but the answer is not obvious to me. please help.
print is a function in Python 3. Use print(line) instead.

Resources