numenta / nupic-legacy

Numenta Platform for Intelligent Computing is an implementation of Hierarchical Temporal Memory (HTM), a theory of intelligence based strictly on the neuroscience of the neocortex.
http://numenta.org/
GNU Affero General Public License v3.0
6.33k stars 1.56k forks source link

After run swarm.py, then have an error in your SQL syntax;1064 error. why? #3105

Open hbyido opened 8 years ago

hbyido commented 8 years ago

I use win8 64bit+anaconda(python 2.7),the nupic installation is ok,mysql installation is ok。 but

%cd F:\one gym
%run swarm.py

ec-center-hourly.csv) and
creates a model parameters file in the `model_params` directory containing
the best model found by the swarm. Dumps a bunch of crud to stdout because
that is just what swarming does at this point. You really don't need to
pay any attention to it.

=================================================
= Swarming on rec-center-hourly data...
= Medium swarm. Sit back and relax, this could take awhile.
=================================================
Generating experiment files in directory: F:\one gym\swarm...
Writing  313 lines...
Writing  114 lines...
done.
None
---------------------------------------------------------------------------
ProgrammingError                          Traceback (most recent call last)
F:\one gym\swarm.py in <module>()
    107 if __name__ == "__main__":
    108   print DESCRIPTION
--> 109   swarm(INPUT_FILE)

F:\one gym\swarm.py in swarm(filePath)
     99   printSwarmSizeWarning(SWARM_DESCRIPTION["swarmSize"])
    100   print "================================================="
--> 101   modelParams = swarmForBestModelParams(SWARM_DESCRIPTION, name)
    102   print "\nWrote the following model param files:"
    103   print "\t%s" % modelParams

F:\one gym\swarm.py in swarmForBestModelParams(swarmConfig, name, maxWorkers)
     76     outDir=permWorkDir,
     77     permWorkDir=permWorkDir,
---> 78     verbosity=0
     79   )
     80   modelParamsFile = writeModelParamsToFile(modelParams, name)

c:\users\administrator\appdata\roaming\python\python27\site-packages\nupic-0.5.2-py2.7.egg\nupic\swarming\permutations_runner.pyc in runWithConfig(swarmConfig, options, outDir, outputLabel, permWorkDir, verbosity)
    275   _validateOptions(runOptions)
    276 
--> 277   return _runAction(runOptions)
    278 
    279 

c:\users\administrator\appdata\roaming\python\python27\site-packages\nupic-0.5.2-py2.7.egg\nupic\swarming\permutations_runner.pyc in _runAction(runOptions)
    216   # Run HyperSearch
    217   elif action in ("run", "dryRun", "pickup"):
--> 218     returnValue = _runHyperSearch(runOptions)
    219   else:
    220     raise Exception("Unhandled action: %s" % action)

c:\users\administrator\appdata\roaming\python\python27\site-packages\nupic-0.5.2-py2.7.egg\nupic\swarming\permutations_runner.pyc in _runHyperSearch(runOptions)
    145   # Run HyperSearch
    146   startTime = time.time()
--> 147   search = _HyperSearchRunner(runOptions)
    148   # Save in global for the signal handler.
    149   gCurrentSearch = search

c:\users\administrator\appdata\roaming\python\python27\site-packages\nupic-0.5.2-py2.7.egg\nupic\swarming\permutations_runner.pyc in __init__(self, options)
    416     """
    417 
--> 418     self.__cjDAO = _clientJobsDB()
    419 
    420     self._options = options

c:\users\administrator\appdata\roaming\python\python27\site-packages\nupic-0.5.2-py2.7.egg\nupic\swarming\permutations_runner.pyc in _clientJobsDB()
    380   Returns: The shared cjdao.ClientJobsDAO instance
    381   """
--> 382   return cjdao.ClientJobsDAO.get()
    383 
    384 

c:\users\administrator\appdata\roaming\python\python27\site-packages\nupic-0.5.2-py2.7.egg\nupic\support\decorators.pyc in exceptionLoggingWrap(*args, **kwargs)
     54     def exceptionLoggingWrap(*args, **kwargs):
     55       try:
---> 56         return func(*args, **kwargs)
     57       except:
     58         logger.exception(

c:\users\administrator\appdata\roaming\python\python27\site-packages\nupic-0.5.2-py2.7.egg\nupic\database\ClientJobsDAO.pyc in get()
    546     if ClientJobsDAO._instance is None:
    547       cjDAO = ClientJobsDAO()
--> 548       cjDAO.connect()
    549 
    550       ClientJobsDAO._instance = cjDAO

c:\users\administrator\appdata\roaming\python\python27\site-packages\nupic-0.5.2-py2.7.egg\nupic\support\decorators.pyc in exceptionLoggingWrap(*args, **kwargs)
     54     def exceptionLoggingWrap(*args, **kwargs):
     55       try:
---> 56         return func(*args, **kwargs)
     57       except:
     58         logger.exception(

c:\users\administrator\appdata\roaming\python\python27\site-packages\nupic-0.5.2-py2.7.egg\nupic\support\decorators.pyc in retryWrap(*args, **kwargs)
    206         numAttempts += 1
    207         try:
--> 208           result = func(*args, **kwargs)
    209         except retryExceptions, e:
    210           if not retryFilter(e, args, kwargs):

c:\users\administrator\appdata\roaming\python\python27\site-packages\nupic-0.5.2-py2.7.egg\nupic\database\ClientJobsDAO.pyc in connect(self, deleteOldVersions, recreate)
    634       # Initialize tables
    635       self._initTables(cursor=conn.cursor, deleteOldVersions=deleteOldVersions,
--> 636                        recreate=recreate)
    637 
    638       # Save our connection id

c:\users\administrator\appdata\roaming\python\python27\site-packages\nupic-0.5.2-py2.7.egg\nupic\support\decorators.pyc in exceptionLoggingWrap(*args, **kwargs)
     54     def exceptionLoggingWrap(*args, **kwargs):
     55       try:
---> 56         return func(*args, **kwargs)
     57       except:
     58         logger.exception(

c:\users\administrator\appdata\roaming\python\python27\site-packages\nupic-0.5.2-py2.7.egg\nupic\database\ClientJobsDAO.pyc in _initTables(self, cursor, deleteOldVersions, recreate)
    673       cursor.execute('DROP DATABASE IF EXISTS %s' % (self.dbName))
    674 
--> 675     cursor.execute('CREATE DATABASE IF NOT EXISTS %s' % (self.dbName))
    676 
    677 

C:\Anaconda2\lib\site-packages\DBUtils\SteadyDB.pyc in tough_method(*args, **kwargs)
    550                     self._setsizes()
    551                 method = getattr(self._cursor, name)
--> 552                 result = method(*args, **kwargs) # try to execute
    553                 if execute:
    554                     self._clearsizes()

C:\Anaconda2\lib\site-packages\pymysql\cursors.pyc in execute(self, query, args)
    130             query = query % self._escape_args(args, conn)
    131 
--> 132         result = self._query(query)
    133         self._executed = query
    134         return result

C:\Anaconda2\lib\site-packages\pymysql\cursors.pyc in _query(self, q)
    269         conn = self._get_db()
    270         self._last_executed = q
--> 271         conn.query(q)
    272         self._do_get_result()
    273         return self.rowcount

C:\Anaconda2\lib\site-packages\pymysql\connections.pyc in query(self, sql, unbuffered)
    724             sql = sql.encode(self.encoding)
    725         self._execute_command(COM_QUERY, sql)
--> 726         self._affected_rows = self._read_query_result(unbuffered=unbuffered)
    727         return self._affected_rows
    728 

C:\Anaconda2\lib\site-packages\pymysql\connections.pyc in _read_query_result(self, unbuffered)
    859         else:
    860             result = MySQLResult(self)
--> 861             result.read()
    862         self._result = result
    863         if result.server_status is not None:

C:\Anaconda2\lib\site-packages\pymysql\connections.pyc in read(self)
   1062     def read(self):
   1063         try:
-> 1064             first_packet = self.connection._read_packet()
   1065 
   1066             # TODO: use classes for different packet types?

C:\Anaconda2\lib\site-packages\pymysql\connections.pyc in _read_packet(self, packet_type)
    824         """
    825         packet = packet_type(self)
--> 826         packet.check_error()
    827         return packet
    828 

C:\Anaconda2\lib\site-packages\pymysql\connections.pyc in check_error(self)
    368             errno = unpack_uint16(self.read(2))
    369             if DEBUG: print("errno =", errno)
--> 370             raise_mysql_exception(self._data)
    371 
    372     def dump(self):

C:\Anaconda2\lib\site-packages\pymysql\err.pyc in raise_mysql_exception(data)
    114 def raise_mysql_exception(data):
    115     errinfo = _get_error_info(data)
--> 116     _check_mysql_exception(errinfo)

C:\Anaconda2\lib\site-packages\pymysql\err.pyc in _check_mysql_exception(errinfo)
    107     errorclass = error_map.get(errno, None)
    108     if errorclass:
--> 109         raise errorclass(errno,errorvalue)
    110 
    111     # couldn't find the right error number

ProgrammingError: (1064, u"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':\\one gym\\' at line 1")

F:\one gym\ is my user environment valuable。 I do not know what wrong with it。can anyone help me?

rhyolight commented 8 years ago

I'm not sure I understand this... but if the value of your USER environment variable is one gym that doesn't make sense to me. The USER value should be your username with no dots, spaces, or dashes.