All nosetests fail on fresh installation

Issue #70 resolved
Jacob Boes created an issue

I've just tried pulling the master branch and running the nosetests and all 9 of them fail. There seem to be two main categories of error:

The first and most common error is:

ERROR: force_call_test.non_periodic_test
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/jacob/python/amp/tests/CuOPd_test/gaussian_neural_test/force_call_test.py", line 181, in non_periodic_test
    images]
  File "/mnt/Omega/python/ase/ase/calculators/calculator.py", line 348, in get_potential_energy
    energy = self.get_property('energy', atoms)
  File "/mnt/Omega/python/ase/ase/calculators/calculator.py", line 387, in get_property
    self.calculate(atoms, [name], system_changes)
  File "/mnt/Omega/python/amp/__init__.py", line 189, in calculate
    calculate_derivatives=False)
  File "/mnt/Omega/python/amp/descriptor/gaussian.py", line 157, in calculate_fingerprints
    self.fingerprints.calculate_items(images, cores=cores, log=log)
  File "/mnt/Omega/python/amp/utilities.py", line 160, in calculate_items
    d[key] = self.calc.calculate(images[key], key)
  File "/mnt/Omega/python/amp/descriptor/gaussian.py", line 204, in calculate
    indexfp = self.get_fingerprint(index, symbol, neighborsymbols, Rs)
  File "/mnt/Omega/python/amp/descriptor/gaussian.py", line 240, in get_fingerprint
    self.globals.cutoff, home, self.fortran)
  File "/mnt/Omega/python/amp/descriptor/gaussian.py", line 450, in calculate_G2
    ridge += (np.exp(-eta * (Rij ** 2.) / (cutoff ** 2.)) *
TypeError: unsupported operand type(s) for ** or pow(): 'dict' and 'float'

These errors can be fixed by changing most instances of the cutoff variable in the amp/descriptor/gaussian.py file to cutoff['kwargs']['Rc'], which I assume was intended?

Changing the above then leads to 5 of the nosetests failing, all with errors similar to the following:

ERROR: train_test.non_periodic_0th_bfgs_step_test
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/jacob/python/amp/tests/CuOPd_test/gaussian_neural_test/train_test.py", line 198, in non_periodic_0th_bfgs_step_test
    calc.train(images=images,)
  File "/mnt/Omega/python/amp/__init__.py", line 242, in train
    calculate_derivatives=calculate_derivatives)
  File "/mnt/Omega/python/amp/descriptor/gaussian.py", line 157, in calculate_fingerprints
    self.fingerprints.calculate_items(images, cores=cores, log=log)
  File "/mnt/Omega/python/amp/utilities.py", line 160, in calculate_items
    d[key] = self.calc.calculate(images[key], key)
  File "/mnt/Omega/python/amp/descriptor/gaussian.py", line 204, in calculate
    indexfp = self.get_fingerprint(index, symbol, neighborsymbols, Rs)
  File "/mnt/Omega/python/amp/descriptor/gaussian.py", line 240, in get_fingerprint
    self.globals.cutoff, home, self.fortran)
  File "/mnt/Omega/python/amp/descriptor/gaussian.py", line 437, in calculate_G2
    ridge = fmodules.calculate_g2(numbers=numbers, rs=Rs,
AttributeError: 'NoneType' object has no attribute 'calculate_g2'

Which is the result of no fmodules file in the amp master directory. Again, I assume this is meant to be compiled from the two .f90 files:

f2py -c -m fmodules descriptor/gaussian.f90 descriptor/zernike.f90

But this is not documented in the README, or doc/ so I cannot confirm. Despite these additions, the final test still fails:

........E
======================================================================
ERROR: test_gaussian_neural.train_test
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/jacob/python/amp/tests/test_gaussian_neural.py", line 55, in train_test
    calc.train(images=train_images,)
  File "/mnt/Omega/python/amp/__init__.py", line 259, in train
    raise TrainingConvergenceError('Amp did not converge upon '
TrainingConvergenceError: Amp did not converge upon training. See log file for more information.
-------------------- >> begin captured stdout << ---------------------
Warning: Desired error not necessarily achieved due to precision loss.
         Current function value: 0.000305
         Iterations: 85
         Function evaluations: 129
         Gradient evaluations: 117

--------------------- >> end captured stdout << ----------------------

----------------------------------------------------------------------
Ran 9 tests in 129.791s

FAILED (errors=1)

However, each time the convergence level is different. Is this meant to happen, or have I made a mistake?

See attached file for log of the final run attempt.

Comments (4)

  1. andrew_peterson repo owner

    Thanks for the report -- they are failing on our nightly builds too and we're working to fix them.

    The development branch has a thorough code re-write on it right now so is in constant flux while we get some of the earlier features back in (mostly just fortran at this stage). The version on branch-v0.4 is probably much more stable until we get these issues worked out.

  2. Jacob Boes reporter

    Im mostly interested in the new tenser flow model. Does that require the fortran code to work efficiently?

  3. Log in to comment