Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notebook pipeline initialization issue #17

Closed
2 of 3 tasks
OliviaLynn opened this issue Nov 14, 2023 · 4 comments
Closed
2 of 3 tasks

Notebook pipeline initialization issue #17

OliviaLynn opened this issue Nov 14, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@OliviaLynn
Copy link
Member

Bug report
When I run fsps_sed_demo.ipynb, I get to this cell:

pipe.initialize(dict(input=trainFile), dict(output_dir='./temp_output_rail_fsps', log_dir='./logs_rail_fsps',
                                            resume=False, nprocess=2), None)
pipe.save('./temp_output_rail_fsps/pipe_saved.yml')

and get:

ValueError: 
Some required inputs to the pipeline could not be found,
(or possibly your pipeline is cyclic):

Stage FSPSSedModeler is missing input(s): training_data

Is this machine/environment specific, or does this happen with others?

I'd love to move the demo notebook into rail (as part of rail#48), but I think it would be better to look into this before moving it around.

Before submitting
Please check the following:

  • I have described the situation in which the bug arose, including what code was executed, information about my environment, and any applicable data others will need to reproduce the problem.
  • I have included available evidence of the unexpected behavior (including error messages, screenshots, and/or plots) as well as a description of what I expected instead.
  • If I have a solution in mind, I have provided an explanation and/or pseudocode and/or task list.
@eacharles
Copy link
Collaborator

eacharles commented Nov 14, 2023 via email

@OliviaLynn OliviaLynn self-assigned this Nov 14, 2023
@eacharles
Copy link
Collaborator

eacharles commented Nov 20, 2023

This will fix your issue:

-    "pipe.initialize(dict(input=trainFile), dict(output_dir='./temp_output_rail_fsps', log_dir='./logs_rail_fsps',\n",
+    "pipe.initialize(dict(training_data=trainFile), dict(output_dir='./temp_output_rail_fsps', log_dir='./logs_rail_fsps',\n",

This in needed b/c of these lines:

training_data = DS.read_file("training_data", TableHandle, trainFile)
fspssedmodel = fspssedmodeler.fit_model(training_data)

The first line creates a DataHandle with the tag training_data, the second line tells fspssedmodeler to look for the input data under the tag training_data.

@eacharles
Copy link
Collaborator

eacharles commented Nov 20, 2023

Note that to get the NB to run to complete I had to make a couple other changes:

-    "fspsphotometrycreator = FSPSPhotometryCreator.make_stage(redshifts_key='redshifts',restframe_sed_key='restframe_seds',\n",
+    "fspsphotometrycreator = FSPSPhotometryCreator.make_stage(redshifts_key='redshifts',\n",
+    "                                                         redshift_key='redshifts',\n",
+    "                                                         restframe_sed_key='restframe_seds',\n",

(It seems like both redshift_key and redshift_keys are used. That should probably be fixed in the Stage)


-    "pipe.initialize(dict(input='input_galaxy_properties_fsps.h5'), dict(output_dir='./temp_output', log_dir='./logs', resume=False, nprocess=2),'./temp_output/pipe_sed_fsps_config.yml')\n",
-    "pipe.save('./temp_output/pipe_saved.yml')\n",
-    "pr = ceci.Pipeline.read('./temp_output/pipe_saved.yml')\n",
+    "pipe.initialize(dict(training_data=input_file), dict(output_dir='./temp_output_rail_fsps', log_dir='./logs', resume=False, nprocess=2),'./temp_output_rail_fsps/pipe_saved_config.yml')\n",
+    "pipe.save('./temp_output_rail_fsps/pipe_saved.yml')\n",
+    "pr = ceci.Pipeline.read('./temp_output_rail_fsps/pipe_saved.yml')\n",

(Fixing up the path)

@ztq1996
Copy link
Contributor

ztq1996 commented Feb 7, 2024

Resolved, closing.

@ztq1996 ztq1996 closed this as completed Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants