ModuleNotFoundError AbstractMemory when building gem5 and nvmain - gem5

After followed build steps on SEAL-UCSB/NVmain, when I run
scons EXTRAS=../NVmain build/X86/gem5.opt
I get the following error.
ModuleNotFoundError: No module named 'AbstractMemory':
File "/project/gem5/SConstruct", line 1243:
SConscript('src/SConscript', variant_dir=variant_path,
File "/usr/lib/scons/SCons/Script/SConscript.py", line 660:
return method(*args, **kw)
File "/usr/lib/scons/SCons/Script/SConscript.py", line 597:
return _SConscript(self.fs, *files, **subst_kw)
File "/usr/lib/scons/SCons/Script/SConscript.py", line 286:
exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
File "/project/hsieh123/gem5/build/X86/SConscript", line 783:
exec('from m5.objects import %s' % modname)
File "<string>", line 1:
File "/project/hsieh123/gem5/build/X86/SConscript", line 763:
exec(compiled, mod.__dict__)
File "/project/hsieh123/NVmain/Simulators/gem5/NVMainMemory.py", line 34:
from AbstractMemory import *

This is due to gem5 version updated and nvmain integration with gem5 is simply out-of-date.
My solution is to replace the two lines in NVmain/Simulators/gem5/NVMainMemory.py at Ln: 34-35
from
from AbstractMemory import *
from ClockDomain import *
to
from m5.objects.AbstractMemory import *
from m5.objects.ClockDomain import *

Related

Error when installing Pandas on Solaris 10

Currently we are on Python 2.7.17, and we are getting the following error:
sbdsvrwm261# ./pip install pandas
Traceback (most recent call last):
File "./pip", line 9, in <module>
load_entry_point('pip==8.1.2', 'console_scripts', 'pip')()
File "/opt/csw/lib/python2.7/site-packages/pkg_resources/__init__.py", line 565, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/opt/csw/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2631, in load_entry_point
return ep.load()
File "/opt/csw/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2291, in load
return self.resolve()
File "/opt/csw/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2297, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/opt/csw/lib/python2.7/site-packages/pip/__init__.py", line 16, in <module>
from pip.vcs import git, mercurial, subversion, bazaar # noqa
File "/opt/csw/lib/python2.7/site-packages/pip/vcs/subversion.py", line 9, in <module>
from pip.index import Link
File "/opt/csw/lib/python2.7/site-packages/pip/index.py", line 30, in <module>
from pip.wheel import Wheel, wheel_ext
File "/opt/csw/lib/python2.7/site-packages/pip/wheel.py", line 39, in <module>
from pip._vendor.distlib.scripts import ScriptMaker
File "/opt/csw/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.py", line 14, in <module>
from .compat import sysconfig, detect_encoding, ZipFile
File "/opt/csw/lib/python2.7/site-packages/pip/_vendor/distlib/compat.py", line 31, in <module>
from urllib2 import (Request, urlopen, URLError, HTTPError,
ImportError: cannot import name HTTPSHandler
If you require further information from me, please let me know.
Thanks
Pandas officially supports Python ^3.5.3.
Have you tried using virtualenv or docker to get Python 3.*?

Tensorflow error - tensorflow.python.framework.errors_impl.NotFoundError: /home/paperspace/nmt-chatbot/data/tst2012.from; No such file or directory

I have been following the sentdex tutorial on a tensorflow chatbot, and on coming t train the chatbot using nmt, tensorflow repeatedly spits out -
tensorflow.python.framework.errors_impl.NotFoundError: /home/paperspace/nmt-chatbot/data/tst2012.from; No such file or directory
I have tried uninstalling and reinstalling tensorflow, but nothing is working
The following is all the error messages I receive:
Traceback (most recent call last):
File "train.py", line 18, in <module>
tf.app.run(main=nmt.main, argv=[os.getcwd() + '\nmt\nmt\nmt.py'] + unparsed)
File "/home/paperspace/.local/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "/home/paperspace/nmt-chatbot/nmt/nmt/nmt.py", line 539, in main
run_main(FLAGS, default_hparams, train_fn, inference_fn)
File "/home/paperspace/nmt-chatbot/nmt/nmt/nmt.py", line 532, in run_main
train_fn(hparams, target_session=target_session)
File "/home/paperspace/nmt-chatbot/nmt/nmt/train.py", line 229, in train
sample_src_data = inference.load_data(dev_src_file)
File "/home/paperspace/nmt-chatbot/nmt/nmt/inference.py", line 75, in load_data
inference_data = f.read().splitlines()
File "/usr/lib/python3.6/codecs.py", line 495, in read
newdata = self.stream.read()
File "/home/paperspace/.local/lib/python3.6/site-packages/tensorflow/python/lib/io/file_io.py", line 119, in read
self._preread_check()
File "/home/paperspace/.local/lib/python3.6/site-packages/tensorflow/python/lib/io/file_io.py", line 79, in _preread_check
compat.as_bytes(self.__name), 1024 * 512, status)
File "/home/paperspace/.local/lib/python3.6/site-packages/tensorflow/python/framework/errors_impl.py", line 473, in __exit__
c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.NotFoundError: /home/paperspace/nmt-chatbot/data/tst2012.from; No such file or directory
The code in the train.py file is...
import sys
import os
import argparse
from setup.settings import hparams
sys.path.append(os.path.realpath(os.path.dirname(__file__)))
sys.path.append(os.path.realpath(os.path.dirname(__file__)) + "/nmt")
from nmt import nmt
import tensorflow as tf
# Modified autorun from nmt.py (bottom of the file)
# We want to use original argument parser (for validation, etc)
nmt_parser = argparse.ArgumentParser()
nmt.add_arguments(nmt_parser)
# But we have to hack settings from our config in there instead of commandline options
nmt.FLAGS, unparsed = nmt_parser.parse_known_args(['--'+k+'='+str(v) for k,v in hparams.items()])
# And now we can run TF with modified arguments
tf.app.run(main=nmt.main, argv=[os.getcwd() + '\nmt\nmt\nmt.py'] + unparsed)
Any help would be really appreciated

Tensorflow NotFoundError: data/mscoco_label_map.pbtxt; No such file or directory

I am trying to run this script from the YouTuber sentdex, but I get this error:
This call to matplotlib.use() has no effect because the backend has already
been chosen; matplotlib.use() must be called *before* pylab, matplotlib.pyplot,
or matplotlib.backends is imported for the first time.
The backend was *originally* set to 'TkAgg' by the following code:
File "Desktop/object.py", line 11, in <module>
from matplotlib import pyplot as plt
File "/usr/local/lib/python2.7/dist-packages/matplotlib/pyplot.py", line 71, in <module>
from matplotlib.backends import pylab_setup
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/__init__.py", line 16, in <module>
line for line in traceback.format_stack()
import matplotlib; matplotlib.use('Agg') # pylint: disable=multiple-statements
Traceback (most recent call last):
File "Desktop/object.py", line 86, in <module>
label_map = label_map_util.load_labelmap(PATH_TO_LABELS)
File "/home/wdjpng/.local/lib/python2.7/site-packages/tensorflow/models/research/object_detection/utils/label_map_util.py", line 132, in load_labelmap
label_map_string = fid.read()
File "/home/wdjpng/.local/lib/python2.7/site-packages/tensorflow/python/lib/io/file_io.py", line 120, in read
self._preread_check()
File "/home/wdjpng/.local/lib/python2.7/site-packages/tensorflow/python/lib/io/file_io.py", line 80, in _preread_check
compat.as_bytes(self.__name), 1024 * 512, status)
File "/home/wdjpng/.local/lib/python2.7/site-packages/tensorflow/python/framework/errors_impl.py", line 519, in __exit__
c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.NotFoundError: data/mscoco_label_map.pbtxt; No such file or directory
OS: Ubuntu 18.04
Python: 2.7
Could you please help me ?
It would help immensly if you provided the file/function you called to produce the traceback. However, in absence of that and based on the below:
tensorflow.python.framework.errors_impl.NotFoundError: data/mscoco_label_map.pbtxt; No such file or directory
The *_label_map.pbtxt path is specified in two lines of the model.config file (exact line numbers depends on the model you chose). It appears one or both the training/test file paths are incorrect.

Observed error while installing PDFMiner for Python2.7

I followed the instruction from here:
file:///home/bioinfo/Descargas/pdfminer3k-1.3.0/docs/index.html
after download pdfminer3k-1.3.0 I did:
python setup.py install
But when I do
pdf2txt.py samples/simple1.pdf
And it doesn't read the pdf, the path is ok.
It give me back the error:
>
Traceback (most recent call last):
File "/usr/local/bin/pdf2txt.py", line 5, in <module>
pkg_resources.run_script('pdfminer3k==1.3.0', 'pdf2txt.py')
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 528, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1394, in run_script
execfile(script_filename, namespace, namespace)
File "/usr/local/lib/python2.7/dist-packages/pdfminer3k-1.3.0-py2.7.egg/EGG-INFO/scripts/pdf2txt.py", line 6, in <module>
from pdfminer.pdfinterp import PDFResourceManager, process_pdf
File "/usr/local/lib/python2.7/dist-packages/pdfminer3k-1.3.0-py2.7.egg/pdfminer/pdfinterp.py", line 5, in <module>
from .cmapdb import CMapDB, CMap
File "/usr/local/lib/python2.7/dist-packages/pdfminer3k-1.3.0-py2.7.egg/pdfminer/cmapdb.py", line 23, in <module>
from .psparser import PSStackParser
File "/usr/local/lib/python2.7/dist-packages/pdfminer3k-1.3.0-py2.7.egg/pdfminer/psparser.py", line 4, in <module>
from .utils import choplist
File "/usr/local/lib/python2.7/dist-packages/pdfminer3k-1.3.0-py2.7.egg/pdfminer/utils.py", line 212, in <module>
0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff,
File "/usr/local/lib/python2.7/dist-packages/pdfminer3k-1.3.0-py2.7.egg/pdfminer/utils.py", line 180, in <genexpr>
PDFDocEncoding = ''.join( chr(x) for x in (
ValueError: chr() arg not in range(256)
Is it any solution?
The latest code (version 20140328) uses unichr(). Try this instead:
pip install pdfminer==20140328
Or download from https://pypi.python.org/pypi/pdfminer/20140328.

xmlrpc server in jython

I've tested in jython the xmlrpc code that works in python:
server code:
import xmlrpclib
from SimpleXMLRPCServer import SimpleXMLRPCServer
def is_even(n):
return n%2 == 0
server = SimpleXMLRPCServer(("localhost", 8000))
print "Listening on port 8000..."
server.register_function(is_even, "is_even")
server.serve_forever()
client code:
import xmlrpclib
proxy = xmlrpclib.ServerProxy("http://localhost:8000/")
print "3 is even: %s" % str(proxy.is_even(3))
print "100 is even: %s" % str(proxy.is_even(100))
I have the errors:
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/xmlrpclib.py", line 1224, in __call__
return self.__send(self.__name, args)
File "/usr/lib/python2.7/xmlrpclib.py", line 1578, in __request
verbose=self.__verbose
File "/usr/lib/python2.7/xmlrpclib.py", line 1264, in request
return self.single_request(host, handler, request_body, verbose)
File "/usr/lib/python2.7/xmlrpclib.py", line 1297, in single_request
return self.parse_response(response)
File "/usr/lib/python2.7/xmlrpclib.py", line 1473, in parse_response
return u.close()
File "/usr/lib/python2.7/xmlrpclib.py", line 793, in close
raise Fault(**self._stack[0])
xmlrpclib.Fault: <Fault 1: "<type 'org.xml.sax.SAXException'>:org.xml.sax.SAXException: SAX2 driver class org.apache.xerces.parsers.SAXParser not found\njava.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser">
I suppose I need to include the xerces library to the server?
It turns oft that I need to include de xerces library into the CLASSPATH. But what I don't understand is why it's not included by default when I install Jython