Skip to content
Discussion options

You must be logged in to vote

Ah. This error is not due to multiprocessing. It's actually due to a couple unrelated issues:

  1. You need to chose a new function name. eval_loss is already used as the internal name, and this appears to be overwriting it somehow (I think). And it seems like it is not overwriting it on the worker process, which leads to a conflict.
  2. It needs to have a 3-arg version available. You should declare it with idx=nothing rather than just idx.

You can fix it with the following patch:

- function eval_loss(tree, dataset::Dataset{T,L}, options, idx)::L where {T,L}
+ function my_custom_loss(tree, dataset::Dataset{T,L}, options, idx=nothing)::L where {T,L}

Also, in the latest PySR/SymbolicRegression.jl,…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@ibengtsson
Comment options

@MilesCranmer
Comment options

Answer selected by ibengtsson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
bug Something isn't working
2 participants
Converted from issue

This discussion was converted from issue #938 on May 23, 2025 11:05.