trax icon indicating copy to clipboard operation
trax copied to clipboard

Reformer: Image Generation: module 'trax' has no attribute 'fastmath'

Open asj100 opened this issue 4 years ago • 2 comments

I've tried to run the Reformer: Image Generation colab a couple of times but get an error message on the last cell: module 'trax' has no attribute 'fastmath'. It may be something I'm doing or not but I can't get it to run.

The entire error message is: AttributeError Traceback (most recent call last) in () 1 flat_prompt = [] ----> 2 for i, img in enumerate(DATA[:trax.fastmath.device_count()]): 3 img = img.reshape((-1, 64, 3))[:32, :, :] 4 flat_prompt.append(img.reshape((-1,))) 5 prompt = np.stack(flat_prompt, 0)

AttributeError: module 'trax' has no attribute 'fastmath' ...

Environment information

OS: <your answer here>

$ pip freeze | grep trax
# your output here

$ pip freeze | grep tensor
# your output here

$ pip freeze | grep jax
# your output here

$ python -V
# your output here

For bugs: reproduction and error logs

# Steps to reproduce:
...
# Error logs:
...

asj100 avatar Aug 17 '20 08:08 asj100

I replace that line with for i, img in enumerate(DATA[:trax.math.device_count()]):

demdecuong avatar Aug 25 '20 11:08 demdecuong

Thanks - works perfectly. Is anyone going to change the original code?

asj100 avatar Aug 25 '20 15:08 asj100