Closed andregalvez79 closed 6 years ago
The problem seems to be that you had files with names such as "trainer.lightgbm_functions.py", and then in the import you mentioned "trainer" again. So then it would try to import fraud_detection/trainer/trainer/lightgbm_functions.py, which doesn't exist.
I have pushed a commit where I have renamed the files in the trainer directory.
If you go to the Preprocessing branch you can find the scripts I'm trying to run. They are a modified version of the cross validation scripts. Mainly I changed the first definition in trainer.preprocessing.py. it's called def preprocess_data(df):
It's strange that Johanna can run it and get the logging info that click_time is being removed, when that doesn't even exist in the scripts anymore.
The structure of my folder is the following in ~/Documents/fraud_detection/ I have a folder named trainer the License and setup.py inside trainer I have:. folder named data (with data) folder named result config.yaml init.py and pyhton scripts from the branch.
I try to run it as:
python lightgbm.py
or with google locally:gcloud ml-engine local train --module-name trainer.lightgbm_main --package-path ~/Documents/fraud_detection/trainer -- --train-file ~/Documents/fraud_detection/trainer/data/train_sample.csv --test-file ~/Documents/fraud_detection/trainer/data/test.csv --job-dir ./tmp/test_script_gcp
I get the error: Traceback (most recent call last): File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main "main", fname, loader, pkg_name) File "/usr/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/home/andre/Documents/fraud_detection/trainer/lightgbm_main.py", line 29, in
import trainer.lightgbm_functions as lf
ImportError: No module named lightgbm_functions