Using the deep_trainer script on the BlackBoxDataset

49 views
Skip to first unread message

Daniel Pineo

unread,
May 10, 2013, 3:30:33 PM5/10/13
to pylea...@googlegroups.com
Hello everyone.  I'm attempting to get up and running with Pylearn2, starting with modifying the deep_trainer script to work with the BlackBoxDataset.  The unsupervised training works fine, but I'm running into an exception when it begins the supervised stage.

The exception indicates that this dataset doesn't have the expected "objective" channel, which appears to be a default.  How do I go about fixing this?  Does the dataset need to be modified to add this channel before it can be used?  Any help would be appreciated, I'm still trying to wrap my head around how all these pieces work together.

Thanks,
- Dan


The stack trace is as follows:

------------------------------------------------------
 Unsupervised training done! Start supervised training...
------------------------------------------------------


Traceback (most recent call last):
  File "D:\Projects\Pylearn\deep_trainer.py", line 310, in <module>
    main()
  File "D:\Projects\Pylearn\deep_trainer.py", line 306, in main
    layer_trainers[-1].main_loop()
  File "C:\Python27\lib\site-packages\pylearn2-0.1dev-py2.7.egg\pylearn2\train.p
y", line 109, in main_loop
    self.algorithm.setup(model=self.model, dataset=self.dataset)
  File "C:\Python27\lib\site-packages\pylearn2-0.1dev-py2.7.egg\pylearn2\trainin
g_algorithms\sgd.py", line 193, in setup
    extra_costs=self.monitoring_costs, mode=self.monitor_iteration_mode
  File "C:\Python27\lib\site-packages\pylearn2-0.1dev-py2.7.egg\pylearn2\monitor
.py", line 660, in setup
    val=cost_value, dataset=cur_dataset)
  File "C:\Python27\lib\site-packages\pylearn2-0.1dev-py2.7.egg\pylearn2\monitor
.py", line 519, in add_channel
    +") that uses targets, but monitoring dataset has no targets")
ValueError: Tried to create a channel (objective) that uses targets, but monitor
ing dataset has no targets
Press any key to continue . . .

Ian Goodfellow

unread,
May 10, 2013, 3:34:52 PM5/10/13
to pylearn-dev
'objective' is the objective function, which is determined by your
Cost and Model, not your dataset.
The problem is that the monitoring dataset has no targets.
"Targets" in the context of the black box challenge means the class
labels to be predicted.
Have you deleted the "y" attribute of the black box dataset somehow?
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "pylearn-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pylearn-dev...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Daniel Pineo

unread,
May 10, 2013, 5:54:11 PM5/10/13
to pylea...@googlegroups.com

Ahh yes, in fact the 'y' attribute did get deleted.  In modifying the deep_trainer script for the BlackBoxDataset, I created a get_dataset_blackbox() function just like the get_dataset_cifar10() and get_dataset_mnist() functions.  Like those functions, it cached the datasets into a pickle file for use in subsequent runs, but I was mistakenly caching them both to the same file, causing subsequent runs to use the same dataset for both the training and test datasets.

Thank you for the pointer on where to look.

- Dan

Ian Goodfellow

unread,
May 14, 2013, 6:44:28 AM5/14/13
to pylearn-dev
For some reason googlegroups decided this message might be spam, but
didn't ask me to moderate it until today.
Are you sure it was returning an empty list?

On Fri, May 10, 2013 at 2:07 PM, Daniel Pineo <dan...@pineo.net> wrote:
> Hello everyone. I'm trying to get up and running using Pylearn2. I'm
> starting by modifying the deep_trainer.py script to instead use the
> BlackBoxDataset.
>
> The unsupervised stages train work fine, but when it gets to the supervised
> stage, it throws an exception. It appears to be attempting to monitor a
> default channel called 'objective', which doesn't exist. In fact, the
> has_targets() call on the dataset object is returning an empty list. What
> is the proper way around this? I'm not yet clear on how all this pieces
> together, could someone point me in the right direction here? Any help
> would be most appreciated.
>
> Here's the trace I'm seeing:

Daniel Pineo

unread,
May 19, 2013, 8:31:11 PM5/19/13
to pylea...@googlegroups.com

No, I should have said it was returning False.
Reply all
Reply to author
Forward
0 new messages