# Checkpoint Backend creation

**URL:** <https://discuss.ray.io/t/checkpoint-backend-creation/2653>\
**Category:** Ray Serve\
**Created:** [June 25, 2021, 11:52am UTC](https://discuss.ray.io/t/checkpoint-backend-creation/2653 "2021-06-25T11:52:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gouthaman](https://avatars.discourse-cdn.com/v4/letter/g/74df32/32.png) [@gouthaman](https://discuss.ray.io/u/gouthaman)\
**Post date:** [June 25, 2021, 11:52am UTC](https://discuss.ray.io/t/checkpoint-backend-creation/2653/1 "2021-06-25T11:52:27Z")

</div>

I was trying creating ray serve for a custom environment with loading the saved checkpoint  
Code:  
serve.create\_backend(“ppo”, ServePPOModel,checkpoint\_path)

I got the following error that I couldn’t understand  
Error:  
pid=5892) 2021-06-25 16:53:14,590 ERROR worker.py:409 – Exception raised in creation task: The actor died because of an error raised in its creation task, ray::eUUVZf:SERVE\_CONTROLLER\_ACTOR:ppo#BQRHCK:RayServeWrappedReplica. **init** (pid=5892, ip=192.168.1.6)  
(pid=5892) File “python\ray\_raylet.pyx”, line 501, in ray.\_raylet.execute\_task  
(pid=5892) File “python\ray\_raylet.pyx”, line 448, in ray.\_raylet.execute\_task.function\_executor  
(pid=5892) File “python\ray\_raylet.pyx”, line 1664, in ray.\_raylet.CoreWorker.run\_async\_func\_in\_event\_loop  
(pid=5892) File “C:\Users\Wavicledata\anaconda3\lib\concurrent\futures\_base.py”, line 432, in result  
(pid=5892) return self.\_\_get\_result()  
(pid=5892) File “C:\Users\Wavicledata\anaconda3\lib\concurrent\futures\_base.py”, line 388, in \_\_get\_result  
(pid=5892) raise self.\_exception  
(pid=5892) File “C:\Users\Wavicledata\anaconda3\lib\site-packages\ray\serve\backend\_worker.py”, line 74, in **init**  
(pid=5892) await sync\_to\_async(\_callable. **init** )(\*init\_args)  
(pid=5892) File “C:\Users\Wavicledata\anaconda3\lib\site-packages\ray\_private\async\_compat.py”, line 29, in wrapper  
(pid=5892) return func(\*args, \*\*kwargs)  
(pid=5892) File “”, line 5, in **init**  
(pid=5892) File “C:\Users\Wavicledata\anaconda3\lib\site-packages\ray\rllib\agents\trainer\_template.py”, line 123, in **init**  
(pid=5892) Trainer. **init** (self, config, env, logger\_creator)  
(pid=5892) File “C:\Users\Wavicledata\anaconda3\lib\site-packages\ray\rllib\agents\trainer.py”, line 548, in **init**  
(pid=5892) super(). **init** (config, logger\_creator)  
(pid=5892) File “C:\Users\Wavicledata\anaconda3\lib\site-packages\ray\tune\trainable.py”, line 98, in **init**  
(pid=5892) self.setup(copy.deepcopy(self.config))  
(pid=5892) File “C:\Users\Wavicledata\anaconda3\lib\site-packages\ray\rllib\agents\trainer.py”, line 709, in setup  
(pid=5892) self.\_init(self.config, self.env\_creator)  
(pid=5892) File “C:\Users\Wavicledata\anaconda3\lib\site-packages\ray\rllib\agents\trainer\_template.py”, line 150, in \_init  
(pid=5892) self.workers = self.\_make\_workers(  
(pid=5892) File “C:\Users\Wavicledata\anaconda3\lib\site-packages\ray\rllib\agents\trainer.py”, line 791, in \_make\_workers  
(pid=5892) return WorkerSet(  
(pid=5892) File “C:\Users\Wavicledata\anaconda3\lib\site-packages\ray\rllib\evaluation\worker\_set.py”, line 92, in **init**  
(pid=5892) self.\_local\_worker = self.\_make\_worker(  
(pid=5892) File “C:\Users\Wavicledata\anaconda3\lib\site-packages\ray\rllib\evaluation\worker\_set.py”, line 367, in \_make\_worker  
(pid=5892) worker = cls(  
(pid=5892) File “C:\Users\Wavicledata\anaconda3\lib\site-packages\ray\rllib\evaluation\rollout\_worker.py”, line 534, in **init**  
(pid=5892) self.\_build\_policy\_map(policy\_dict, policy\_config)  
(pid=5892) File “C:\Users\Wavicledata\anaconda3\lib\site-packages\ray\rllib\evaluation\rollout\_worker.py”, line 1193, in _build\_policy\_map  
(pid=5892) policy\_map[name] = cls(obs\_space, act\_space, merged\_conf)  
(pid=5892) File “C:\Users\Wavicledata\anaconda3\lib\site-packages\ray\rllib\policy\tf\_policy\_template.py”, line 237, in **init**  
(pid=5892) DynamicTFPolicy. **init** (  
(pid=5892) File “C:\Users\Wavicledata\anaconda3\lib\site-packages\ray\rllib\policy\dynamic\_tf\_policy.py”, line 158, in **init**  
(pid=5892) dist\_class, logit\_dim = ModelCatalog.get\_action\_dist(  
(pid=5892) File “C:\Users\Wavicledata\anaconda3\lib\site-packages\ray\rllib\models\catalog.py”, line 245, in get\_action\_dist  
(pid=5892) assert np.all(action\_space.high == high_)  
(pid=5892) AssertionError  
(pid=13360) 2021-06-25 16:53:14,694 ERROR controller.py:121 – Exception updating backend state: Failed to look up actor with name ‘eUUVZf:SERVE\_CONTROLLER\_ACTOR:ppo#BQRHCK’. You are either trying to look up a named actor you didn’t create, the named actor died, or the actor hasn’t been created because named actor creation is asynchronous.

Could you help to know what this error is

---

<div class="post-metadata">

**Author:** ![architkulkarni](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/architkulkarni/32/10_2.png) [@architkulkarni](https://discuss.ray.io/u/architkulkarni)\
**Post date:** [June 25, 2021, 6:34pm UTC](https://discuss.ray.io/t/checkpoint-backend-creation/2653/2 "2021-06-25T18:34:27Z")

</div>

It looks like there was an error initializing the class. I wonder, if you try to instantiate the class ServePPOModel normally (without using Ray Serve), do you get the same RLlib error?

Are you running this tutorial [RLlib Tutorial — Ray v2.0.0.dev0](https://docs.ray.io/en/master/serve/tutorials/rllib.html) or have you made some changes to it? cc @simon-mo

---

<div class="post-metadata">

**Author:** ![gouthaman](https://avatars.discourse-cdn.com/v4/letter/g/74df32/32.png) [@gouthaman](https://discuss.ray.io/u/gouthaman)\
**Post date:** [June 28, 2021, 5:19am UTC](https://discuss.ray.io/t/checkpoint-backend-creation/2653/3 "2021-06-28T05:19:21Z")

</div>

Yeah, I have used that tutorial as the reference, it is working for another environment, it is not working for this particular environment.  
Even when trying to instantiate the class ServePPOModel normally, I am getting the same assertion error  
assert np.all(action\_space.high == high\_)  
in the code file ray\rllib\models\catalog.py

---

<div class="post-metadata">

**Author:** ![gouthaman](https://avatars.discourse-cdn.com/v4/letter/g/74df32/32.png) [@gouthaman](https://discuss.ray.io/u/gouthaman)\
**Post date:** [June 28, 2021, 7:18am UTC](https://discuss.ray.io/t/checkpoint-backend-creation/2653/4 "2021-06-28T07:18:36Z")

</div>

Also, the code works only with ray 1.0.0, so saving the checkpoint I do with this version and deploying I do with ray 1.4.0.  
If I change saving the checkpoint to ray 1.0.0, I get the following error  
if dtype not in (dtypes.float16, dtypes.bfloat16, dtypes.float32,  
dtypes.float64, dtypes.int32, dtypes.int64):  
raise ValueError(“Invalid dtype %r” % dtype)

ValueError: Invalid dtype tf.int16
