How to upgrade Magento 2 after «Resource» was renamed to «ResourceModel» at 2015-10-07

Resource models was renamed from Resource to ResourceModel.
It leads to the bug 2072.

To fix the bug run the script below:

START TRANSACTION;
SET @from = '\\Resource\\';
SET @to = '\\ResourceModel\\';
UPDATE eav_attribute SET attribute_model = REPLACE(attribute_model, @from, @to);
UPDATE eav_attribute SET backend_model = REPLACE(backend_model, @from, @to);
UPDATE eav_attribute SET source_model = REPLACE(source_model, @from, @to);
UPDATE eav_entity_type SET entity_model = REPLACE(entity_model, @from, @to);
UPDATE eav_entity_type SET attribute_model = REPLACE(attribute_model, @from, @to);
UPDATE eav_entity_type SET entity_attribute_collection = REPLACE(entity_attribute_collection, @from, @to);
COMMIT;

Thanks for script, but still getting below error:
Class Magento\Customer\Model\ResourceModel\AddressModel\Attribute\Collection does not exist

Your problem is not related to the topic.
I think the source of your problem is an extension or a code modification.
I suggest you to search your code and database for the string Magento\Customer\Model\ResourceModel\AddressModel\Attribute\Collection: where is it come from?