-
Notifications
You must be signed in to change notification settings - Fork 70
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
ValueError: Argument name
must be a string and cannot contain character /
. Received: name=build_factored_surrogate_posterior/loc_0_momentum
#86
Comments
Hi @vanderwoodde , Just tested here and found the same issue. Unfortunately it doesn't seem there's much we could do on our side; apparently this is happening in the integration between keras and tfp which is outside of our control. I opened an issue on their repo, let's see how the discussion evolves. For now I recommend doing as you did, lowering versions specs might be good enough for now. Thanks for letting us know about this, as soon as we find how to work around the issue I'll update tfci. |
I think this comment has a solution to the problem: tensorflow/probability#1799 (comment) In my local system, I replaced this line https://github.com/WillianFuks/tfcausalimpact/blob/master/causalimpact/model.py#L362: -optimizer = tf.optimizers.Adam(learning_rate=0.1)
+optimizer = tf_keras.optimizers.Adam(learning_rate=0.1) After this, everything seemed to work fine. However, I am not sure whether there are any side effects since I am not familiar with the differences between Additionally, based on my understanding, Edit: I just noticed the following warning (I'm using M2 CPU):
Using optimizer = tf_keras.optimizers.legacy.Adam(learning_rate=0.1) I was able to make the warning message disappear, which slightly sped up the execution time. import platform
import tf_keras
keras_optimizer = tf_keras.optimizer.legacy if platform.machine() == 'arm64' else tf_keras.optimizer
optimizer = keras_optimizer.Adam(learning_rate=0.1) |
Thanks for the input @williamjamir , I just implemented as you suggested, things seems to be working now. Please @vanderwoodde , could you test the rc with the fix? just run |
@WillianFuks Yes, that rc solved the issue I was having. The sample code ran error-free with 0.0.15rc0. Thanks! |
Thanks for the update. Stable version has just been released: |
Hello,
When running the code from the example:
`import pandas as pd
from causalimpact import CausalImpact
data = pd.read_csv( 'https://raw.githubusercontent.com/WillianFuks/tfcausalimpact/master/tests/fixtures/arma_data.csv' )[['y', 'X']]
data.iloc[70:, 0] += 5
pre_period = [0, 69]
post_period = [70, 99]
ci = CausalImpact(data, pre_period, post_period)
print(ci.summary())
print(ci.summary(output='report'))
ci.plot()`
I received the following error:
"ValueError: Argument
name
must be a string and cannot contain character/
. Received: name=build_factored_surrogate_posterior/loc_0_momentum"This only happens when using the default ('vi') fit method. If I update the fit_method to 'hmc' the code will run as expected.
My current package versions are:
tensorflow: 2.16.1
tensorflow-probability: 0.24.0
tf-keras: 2.16.0
tfcausalimpact : 0.0.14
The tfcausalimpact package works as expected if I step back to:
tensorflow: 2.15.1
tensorflow-probability: 0.23.0
tf-keras: 2.15.0
Would you recommend locking in those package versions if I am looking to run this in a production environment or will it be important to keep my tensorflow and causalimpact packages up to date?
The text was updated successfully, but these errors were encountered: