Closed chadlagore closed 6 years ago
Damn this is pretty cool, I'll try and review it tomorrow night 👍
this is probably my lack of knowledge but I'm getting pytest: error: unrecognized arguments: --cov=minutes
, anything I forgot to do? pipenv shell works fine.
Try removing the --cov=minutes
. pipenv install
should have installed pyest-cov
🤔
I'll have a look :eyes:
Edit: I had pytest install
above before :joy: thats what probably messed up @Schemetrical
When I try pytest install
I get ERROR: file not found: install
I’m assuming that’s what I’m missing maybe
Le 25 mai 2018 à 07:45, Chad notifications@github.com a écrit :
Try removing the --cov=minutes. pytest install should have installed pyest-cov 🤔
I'll have a look 👀
— You are receiving this because your review was requested. Reply to this email directly, view it on GitHub, or mute the thread.
Try pipenv install Yichen!
pipenv install -> pipenv shell -> pytestinstall (fails here)
maybe i'm missing a step
On May 25, 2018, at 09:02, Chad notifications@github.com wrote:
Try pipenv install Yichen!
— You are receiving this because your review was requested. Reply to this email directly, view it on GitHub https://github.com/ubclaunchpad/minutes/pull/122#issuecomment-392104483, or mute the thread https://github.com/notifications/unsubscribe-auth/AFHdsUXUGRQNuQs0NcxkzQIcM0QdeIJ6ks5t2CscgaJpZM4UH8u6.
On the contrary @Schemetrical, you're adding a step 😄
pipenv install # Install dependencies
pipenv shell # Enter environment subshell
pytest --cov=minutes -vvv test # Run tests (no pytest install)
I can see that pytest-cov is in the Pipfile and pipenv install
and pipenv shell
both are fine, somehow the test is spitting out E ModuleNotFoundError: No module named 'keras'
. Additionally, --cov still does not work. I'll see if I can ask grig this weekend or maybe if you're there too. Sorry this CR is taking so long lol
Perhaps @grig-guz can approve this
@Schemetrical once I get home and try to run it myself ;)
@chadlagore I have the exact same problems as @Schemetrical , here is the log:
============================= test session starts ==============================
platform linux -- Python 3.6.4, pytest-3.3.2, py-1.5.2, pluggy-0.6.0 -- /home/grigorii/anaconda3/bin/python
cachedir: .cache
rootdir: /home/grigorii/projects/minutes, inifile:
collected 0 items / 4 errors
==================================== ERRORS ====================================
_____________________ ERROR collecting test/test_audio.py ______________________
ImportError while importing test module '/home/grigorii/projects/minutes/test/test_audio.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../anaconda3/lib/python3.6/site-packages/_pytest/python.py:403: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
../../anaconda3/lib/python3.6/site-packages/py/_path/local.py:668: in pyimport
__import__(modname)
../../anaconda3/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:213: in load_module
py.builtin.exec_(co, mod.__dict__)
test/test_audio.py:3: in <module>
from minutes.audio import Audio
minutes/__init__.py:1: in <module>
from .minutes import Minutes # noqa
minutes/minutes.py:3: in <module>
from keras.layers import Dense
E ModuleNotFoundError: No module named 'keras'
______________________ ERROR collecting test/test_base.py ______________________
ImportError while importing test module '/home/grigorii/projects/minutes/test/test_base.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../anaconda3/lib/python3.6/site-packages/_pytest/python.py:403: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
../../anaconda3/lib/python3.6/site-packages/py/_path/local.py:668: in pyimport
__import__(modname)
../../anaconda3/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:213: in load_module
py.builtin.exec_(co, mod.__dict__)
test/test_base.py:6: in <module>
from minutes.models import MINUTES_MODELS_DIRECTORY
minutes/__init__.py:1: in <module>
from .minutes import Minutes # noqa
minutes/minutes.py:3: in <module>
from keras.layers import Dense
E ModuleNotFoundError: No module named 'keras'
____________________ ERROR collecting test/test_minutes.py _____________________
ImportError while importing test module '/home/grigorii/projects/minutes/test/test_minutes.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../anaconda3/lib/python3.6/site-packages/_pytest/python.py:403: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
../../anaconda3/lib/python3.6/site-packages/py/_path/local.py:668: in pyimport
__import__(modname)
../../anaconda3/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:213: in load_module
py.builtin.exec_(co, mod.__dict__)
test/test_minutes.py:1: in <module>
from minutes import Minutes
minutes/__init__.py:1: in <module>
from .minutes import Minutes # noqa
minutes/minutes.py:3: in <module>
from keras.layers import Dense
E ModuleNotFoundError: No module named 'keras'
____________________ ERROR collecting test/test_speaker.py _____________________
ImportError while importing test module '/home/grigorii/projects/minutes/test/test_speaker.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../anaconda3/lib/python3.6/site-packages/_pytest/python.py:403: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
../../anaconda3/lib/python3.6/site-packages/py/_path/local.py:668: in pyimport
__import__(modname)
../../anaconda3/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:213: in load_module
py.builtin.exec_(co, mod.__dict__)
test/test_speaker.py:1: in <module>
import test.config as c
test/config.py:7: in <module>
from minutes import Speaker
minutes/__init__.py:1: in <module>
from .minutes import Minutes # noqa
minutes/minutes.py:3: in <module>
from keras.layers import Dense
E ModuleNotFoundError: No module named 'keras'
!!!!!!!!!!!!!!!!!!! Interrupted: 4 errors during collection !!!!!!!!!!!!!!!!!!!!
=========================== 4 error in 0.39 seconds ============================
Hmm, it's strange that Keras seems to not be being installed properly for you guys; it works fine on my machine (with a clean virtualenv and everything), and the Travis build seems to succeed. I would have suggested doing a pipenv install --dev
instead, but Keras isn't even a development dependency, so pipenv install
should cover it. 🤔
Indeed, Travis builds it no problem. Thanks for the log @grig-guz. Can we see a full log of the following:
$ pipenv install
$ pipenv shell
$ pipenv graph
$ which python
$ python -c "import keras; print(keras.__version__)"
$ pytest test
Sorry, keras was for some reason not in my conda environment lol. Tests pass now:
(minutes-ctwz2cxW) grigorii minutes $ pytest -vvv test
============================= test session starts ==============================
platform linux -- Python 3.6.4, pytest-3.3.2, py-1.5.2, pluggy-0.6.0 -- /home/grigorii/anaconda3/bin/python
cachedir: .cache
rootdir: /home/grigorii/projects/minutes, inifile:
collected 12 items
test/test_audio.py::test_add_audio PASSED [ 8%]
test/test_audio.py::test_samples_per_observation PASSED [ 16%]
test/test_audio.py::test_get_spectrograms PASSED [ 25%]
test/test_base.py::test_add_speakers PASSED [ 33%]
test/test_base.py::test_unique_speakers PASSED [ 41%]
test/test_base.py::test_generate_training_data PASSED [ 50%]
test/test_base.py::test_train PASSED [ 58%]
test/test_base.py::test_save_and_load_model PASSED [ 66%]
test/test_base.py::test_home PASSED [ 75%]
test/test_minutes.py::test_train PASSED [ 83%]
test/test_speaker.py::test_speaker_add_samples PASSED [ 91%]
test/test_speaker.py::test_speaker_equality PASSED [100%]
========================== 12 passed in 4.93 seconds ===========================
However, I had to install soundfile and keras by hand, I don't think it is intended to be like that. I am not sure why keras is not being installed, but with soundfile, maybe it's the naming problem: soundfile and pysoundfile.
There are no more conda
environments :) everything is managed by pipenv
now.
@chadlagore still doesn't run with --cov=minutes
though, if that's ok I'll approve.
Would be good to figure out the pipenv
issues that @Schemetrical and @grig-guz are running into, since the promise of pipenv
was to avoid these problems in the first place! 😱
Ticket #118–Reusing the Parameters Fixed by the Parent Model
:construction_worker: Changes
BaseModel.save
serializes theBaseModel
without pickling.Minutes.__init__
collects aparent
(BaseModel
) to build from, reusing all of the "fixed" parameters that that parent necessarily enforces on the transfer model (which is the point of this PR).:flashlight: Testing Instructions
Run the tests,
Additionally, I ran the following smoke test on the model to make sure nothing broke: