Skip to content

ch02_basics/moving_avg.py TypeError: Can not convert a float32 into a Tensor.  #31

Description

@AlexPetit12

Hi,

I am trying to reproduce your exponential moving average example but I get the error "TypeError: Can not convert a float32 into a Tensor. "

I modified the lines

        summary_str, curr_value = sess.run([merged, update_avg], feed_dict={curr_value: raw_data[i]})
        sess.run(tf.assign(prev_avg, curr_value))
        print(raw_data[i], curr_value)

for

        summary_str, curr_value_float = sess.run([merged, update_avg], feed_dict={curr_value: raw_data[i]})
        sess.run(tf.assign(prev_avg, curr_value_float))
        print(raw_data[i], curr_value_float)

to make things work, but I was wondering is this way the best solution or can we do better?

Thanks

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions